This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SK-TDA4VM: onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL.

Part Number: SK-TDA4VM
Other Parts Discussed in Thread: TDA4VM

在pc端编译好模型生成

./model-artifacts
./models并复制到开发板后,

我在tda4vm开发板上运行:

/opt/edgeai-tidl-tools/examples/osrt_python/ort# python3 onnxrt_p.py

报错显示:

Available execution providers :  ['TIDLExecutionProvider', 'TIDLCompilationProv]
                                                                                
Running 4 Models - ['cl-ort-resnet18-v1', 'cl-ort-caffe_squeezenet_v1_1', 'ss-o]
                                                                                
                                                                                
Running_Model :  cl-ort-resnet18-v1                                             
                                                                                
Traceback (most recent call last):                                              
  File "onnxrt_ep.py", line 251, in <module>                                    
    run_model(model, mIdx)                                                      
  File "onnxrt_ep.py", line 165, in run_model                                   
    sess = rt.InferenceSession(config['model_path'] ,providers=EP_list, provide)
  File "/usr/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_
    self._create_inference_session(providers, provider_options)                 
  File "/usr/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inferencen
    sess = C.InferenceSession(session_options, self._model_path, True, self._re)
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL.

官方文档里对tidl_tools_path说明是:set to environment variable TIDL_TOOLS_PATH, usually psdk_rtos_install/tidl_xx_yy_zz_ww/ti_dl/tidl_tools

但我没有在tda4里找到这个路径,只有相似的这个:/usr/include/processor_sdk/tidl_j721e_08_02_00_11/ti_dl/inc,所以将tidl_tools_path设置为了这个,不知道是不是这个原因,但我找不到正确的路径

请问这个问题该如何解决?

  • 请看我们e2e工程师下面的回复。

    How was the model compiled on PC? Through TIDL repo or through edgeai-tidl-tools. To run inference on EVM, you need to compile on PC using the same script : "python3 onnxrt_ep.py -c". This needs tidl_tools which are present as part of the edgeai-tidl-tools at the top most hierarchy level. The path can be set to that itself something like below:

    cd edgeai-tidl-tools

    export TIDL_TOOLS_PATH=$(pwd)/tidl_tools

    Note that tidl_tools will be available only after running the setup.sh script , so ensure it is run first.

    Also, tidl_tools are needed only for compilation, so on EVM, it can just be set empty - export TIDL_TOOLS_PATH=

    Can you make sure above is done? If yes, then we can check if there is any other issue.

  • 我在sk-tda4m上设置TIDL_TOOLS_PATH为空,然后运行在pc端已经编译好的模型(ti官方提供的):

    /opt/edgeai-tidl-tools/examples/osrt_python/ort# python3 onnxrt_ep.py

    报错显示:

    ERROR: Running TIDL graph ... Failed !!!                                       
     17797.921622 s:  VX_ZONE_ERROR:[ownContextSendCmd:815] Command ack message re1
     17797.921649 s:  VX_ZONE_ERROR:[ownContextSendCmd:851] tivxEventWait() failed.
     17797.921670 s:  VX_ZONE_ERROR:[ownNodeKernelInit:538] Target kernel, TIVX_CMe
     17797.921676 s:  VX_ZONE_ERROR:[ownNodeKernelInit:539] Please be sure the tare
     17797.921682 s:  VX_ZONE_ERROR:[ownNodeKernelInit:540] If the target callbackl
     17797.921691 s:  VX_ZONE_ERROR:[ownGraphNodeKernelInit:583] kernel init for n!
     17797.921699 s:  VX_ZONE_ERROR:[vxVerifyGraph:2055] Node kernel init failed   
     17797.921704 s:  VX_ZONE_ERROR:[vxVerifyGraph:2109] Graph verify failed       
     17797.921804 s:  VX_ZONE_ERROR:[ownGraphScheduleGraphWrapper:820] graph is nod
     17797.921810 s:  VX_ZONE_ERROR:[vxProcessGraph:755] schedule graph failed     
     17797.921816 s:  VX_ZONE_ERROR:[vxProcessGraph:760] wait graph failed         
    ERROR: Running TIDL graph ... Failed !!!                                       
     17798.056295 s:  VX_ZONE_ERROR:[ownContextSendCmd:815] Command ack message re1
     17798.056321 s:  VX_ZONE_ERROR:[ownContextSendCmd:851] tivxEventWait() failed.
     17798.056343 s:  VX_ZONE_ERROR:[ownNodeKernelInit:538] Target kernel, TIVX_CMe
     17798.056349 s:  VX_ZONE_ERROR:[ownNodeKernelInit:539] Please be sure the tare
     17798.056355 s:  VX_ZONE_ERROR:[ownNodeKernelInit:540] If the target callbackl
     17798.056363 s:  VX_ZONE_ERROR:[ownGraphNodeKernelInit:583] kernel init for n!
     17798.056372 s:  VX_ZONE_ERROR:[vxVerifyGraph:2055] Node kernel init failed   
     17798.056378 s:  VX_ZONE_ERROR:[vxVerifyGraph:2109] Graph verify failed       
     17798.056481 s:  VX_ZONE_ERROR:[ownGraphScheduleGraphWrapper:820] graph is nod
     17798.056487 s:  VX_ZONE_ERROR:[vxProcessGraph:755] schedule graph failed     
     17798.056493 s:  VX_ZONE_ERROR:[vxProcessGraph:760] wait graph failed         
    ERROR: Running TIDL graph ... Failed !!!                                       
                                                                                   
    Saving image to  ../../../output_images/                                       
                                                                                   
                                                                                   
    Completed_Model :     4, Name : od-ort-ssd-lite_mobilenetv2_fpn                
                                                                                   
                                                                                   
     17798.065289 s:  VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Don!
     17798.069637 s:  VX_ZONE_INIT:[tivxDeInitLocal:193] De-Initialization Done !!!
    APP: Deinit ... !!!                                                            
    REMOTE_SERVICE: Deinit ... !!!                                                 
    REMOTE_SERVICE: Deinit ... Done !!!                                            
    IPC: Deinit ... !!!                                                            
    IPC: DeInit ... Done !!!                                                       
    MEM: Deinit ... !!!                                                            
    MEM: Alloc's: 8 alloc's of 5224020 bytes                                       
    MEM: Free's : 8 free's  of 5224020 bytes                                       
    MEM: Open's : 0 allocs  of 0 bytes                                             
    MEM: Deinit ... Done !!!                                                       
    APP: Deinit ... Done !!!

    请问该如何解决呢?

  • 已经把您的问题更新到e2e帖子,请关注帖子的回复。