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.

TDA4VM: Building sdk 8.5 and some issues with building tidl library

Part Number: TDA4VM

Hi, 

We are trying to build sdk 8.5 on our end. 

Most of the build process has been smooth. We are able to perform "make sdk -j4" and also "make vision_apps -j4"

It builds everything. 

To build tidl_j721e_08_05_00_16, I installed the pre-requisites like opencv, protobuf, flatbuffs of the required version as mentioned in the docs. Running "make all" for the TIDL_INSTALL_PATH did a clean install of everything. There were no errors. 

However, when I look at the out directory of ti_dl/utils/tidlModelImport/out/  I only see two files tidl_model_import.out and tidl_model_import.so 

Normally in the previous releases, other executables like tidl_model_import_onnx.so and tidl_model_import_tflite.so were also present here. Am I missing some instructions in building or are these executables in a different location?

Second problem:

similar to this post -> (https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1206512/tda4vm-outargs-should-be-a-user_data_object-of-name-tidl_outargs?tisearch=e2e-sitesearch&keymatch=should%20be%20a%20user_data_object#)

I went along and installed edgeai-tidl-tools https://github.com/TexasInstruments/edgeai-tidl-tools
I downloaded the tidl_tools.tar file and linked the missing exectuables/.so files to the downloaded files. 

I do the install using the following command -> source ./setup.sh --skip_arm_gcc_download

When I go to examples folder and try to run one of the examples, it gives the following log. 

python3 onnxrt_ep.py -c
Available execution providers : ['TIDLExecutionProvider', 'TIDLCompilationProvider', 'CPUExecutionProvider']

Running 1 Models - ['cl-ort-resnet18-v1']


Running_Model : cl-ort-resnet18-v1


Running shape inference on model ../../../models/public/resnet18_opset9.onnx

2023-04-24 08:44:01.035260978 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer4.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035291499 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer4.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035299279 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer4.0.downsample.1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035305578 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer4.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035311571 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer3.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035317995 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer1.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035323983 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer1.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035329499 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer4.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035334867 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer3.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035340385 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer3.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035346011 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035351654 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer1.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035356974 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer2.0.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035362759 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer1.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035368214 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer2.0.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035373729 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer2.0.downsample.1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035379597 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer2.1.bn1.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035385560 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer2.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035391203 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer3.1.bn2.num_batches_tracked'. It is not used by any node and should be removed from the model.
2023-04-24 08:44:01.035396945 [W:onnxruntime:, graph.cc:3106 CleanUnusedInitializers] Removing initializer 'layer3.0.downsample.1.num_batches_tracked'. It is not used by any node and should be removed from the model.

Preliminary subgraphs created = 1
Final number of subgraphs created are : 1, - Offloaded Nodes - 52, Total Nodes - 52

************** Frame index 1 : Running float import *************
WARNING: [TIDL_E_DATAFLOW_INFO_NULL] Network compiler returned with error or didn't executed, this model can only be used on PC/Host emulation mode, it is not expected to work on target/EVM.
****************************************************
** 1 WARNINGS 0 ERRORS **
****************************************************
The soft limit is 2048
The hard limit is 2048
MEM: Init ... !!!
MEM: Init ... Done !!!
0.0s: VX_ZONE_INIT:Enabled
0.7s: VX_ZONE_ERROR:Enabled
0.10s: VX_ZONE_WARNING:Enabled
0.1162s: VX_ZONE_INIT:[tivxInit:184] Initialization Done !!!
0.27939s: VX_ZONE_ERROR:[tivxTIDLValidate:193] 'outArgs' should be a user_data_object of name:
TIDL_outArgs
0.27949s: VX_ZONE_ERROR:[ownGraphNodeKernelValidate:531] node kernel validate failed for kernel com.ti.tidl:1:1 at index 0
0.27951s: VX_ZONE_ERROR:[vxVerifyGraph:1941] Node kernel Validate failed
0.27953s: VX_ZONE_ERROR:[vxVerifyGraph:2109] Graph verify failed
TIDL_RT_OVX: ERROR: Verifying TIDL graph ... Failed !!!
TIDL_RT_OVX: ERROR: Verify OpenVX graph failed
0.28502s: VX_ZONE_ERROR:[tivxTIDLValidate:193] 'outArgs' should be a user_data_object of name:
TIDL_outArgs
0.28508s: VX_ZONE_ERROR:[ownGraphNodeKernelValidate:531] node kernel validate failed for kernel com.ti.tidl:1:1 at index 0
0.28510s: VX_ZONE_ERROR:[vxVerifyGraph:1941] Node kernel Validate failed
0.28511s: VX_ZONE_ERROR:[vxVerifyGraph:2109] Graph verify failed
0.28533s: VX_ZONE_ERROR:[ownGraphScheduleGraphWrapper:799] graph is not in a state required to be scheduled
0.28535s: VX_ZONE_ERROR:[vxProcessGraph:734] schedule graph failed
0.28537s: VX_ZONE_ERROR:[vxProcessGraph:739] wait graph failed
ERROR: Running TIDL graph ... Failed !!!

********** Frame Index 1 : Running float inference **********
0.106875s: VX_ZONE_ERROR:[tivxTIDLValidate:193] 'outArgs' should be a user_data_object of name:
TIDL_outArgs
0.106889s: VX_ZONE_ERROR:[ownGraphNodeKernelValidate:531] node kernel validate failed for kernel com.ti.tidl:1:1 at index 0
0.106891s: VX_ZONE_ERROR:[vxVerifyGraph:1941] Node kernel Validate failed
0.106893s: VX_ZONE_ERROR:[vxVerifyGraph:2109] Graph verify failed
0.106916s: VX_ZONE_ERROR:[ownGraphScheduleGraphWrapper:799] graph is not in a state required to be scheduled
0.106918s: VX_ZONE_ERROR:[vxProcessGraph:734] schedule graph failed
0.106920s: VX_ZONE_ERROR:[vxProcessGraph:739] wait graph failed
ERROR: Running TIDL graph ... Failed !!!

********** Frame Index 2 : Running fixed point mode for calibration **********

~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~

Processing config file #0 : /data/niranjan/tda4vm_envs/sdk_release_8.5/tda4vm_8_5_sd_card_env/sdk_files/ti-processor-sdk-rtos-j721e-evm-08_05_00_11/tidl_j721e_08_05_00_16/ti_dl/test/onnxrt/edgeai-tidl-tools/model-artifacts/cl-ort-resnet18-v1/tempDir/191_tidl_io_.qunat_stats_config.txt
----------------------- TIDL Process with REF_ONLY FLOW ------------------------

# 0 . .. T 3929.57 .... ..... ... .... .....
# 1 . .. T 3963.86 .... ..... ... .... .....
~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~

Processing config file #0 : /data/niranjan/tda4vm_envs/sdk_release_8.5/tda4vm_8_5_sd_card_env/sdk_files/ti-processor-sdk-rtos-j721e-evm-08_05_00_11/tidl_j721e_08_05_00_16/ti_dl/test/onnxrt/edgeai-tidl-tools/model-artifacts/cl-ort-resnet18-v1/tempDir/191_tidl_io_.qunat_stats_config.txt
----------------------- TIDL Process with REF_ONLY FLOW ------------------------

# 0 . .. T 4369.02 .... ..... ... .... .....
# 1 . .. T 4356.36 .... ..... ... .... .....


***************** Calibration iteration number 0 completed ************************


------------------ Network Compiler Traces -----------------------------
successful Memory allocation
****************************************************
** ALL MODEL CHECK PASSED **
****************************************************

Completed_Model : 1, Name : cl-ort-resnet18-v1 , Total time : -3746935235371.39, Offload Time : 0.08 , DDR RW MBs : 0, Output File : py_out_cl-ort-resnet18-v1_ADE_val_00001801.jpg


MEM: Deinit ... !!!
MEM: Alloc's: 7 alloc's of 48301252 bytes
MEM: Free's : 7 free's of 48301252 bytes
MEM: Open's : 0 allocs of 0 bytes
MEM: Deinit ... Done !!!

I think the problem is with tivxTIDLValidate. It probably has to do something with rt library. Or maybe I have configured it a wrong way? Could you suggest any ideas on this? The same thing of calling inference used to work with sdk 8.0. So I guess it is valid that this should not throw any errors. 

Could you please answer the above two questions.

Thank You

Niranjan