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.
Hi there:
We are working on the TDA4 EVM .
I've downloaded the *.onnx and *.prototxt files from the url https://github.com/TexasInstruments/edgeai-modelzoo/tree/master/models/vision/detection/coco/edgeai-yolox.
Also , I uesd the " ./out/tidl_model_import.out " to transform the onnx file to the yolox_net.bin and yolox_io.bin files.
The releated files are as below:
cmd: ./out/tidl_model_import.out ../../test/testvecs/config/import/public/onnx/tidl_import_yolox-s-ti-lite_39p1_57p9.txt
modelType = 2 numParamBits = 8 numFeatureBits = 8 quantizationStyle = 3 #quantizationStyle = 2 inputNetFile = "../../test/testvecs/models/public/onnx/yolox-s-ti-lite_39p1_57p9.onnx" outputNetFile = "../../test/testvecs/config/tidl_models/onnx/yolox-s-ti-lite_39p1_57p9/tidl_net_yolox-s-ti-lite_39p1_57p9.bin" outputParamsFile = "../../test/testvecs/config/tidl_models/onnx/yolox-s-ti-lite_39p1_57p9/tidl_io_yolox-s-ti-lite_39p1_57p9_" inDataNorm = 1 inMean = 0 0 0 inScale = 0.003921568627 0.003921568627 0.003921568627 inDataFormat = 1 inWidth = 640 inHeight = 640 inNumChannels = 3 numFrames = 1 inData = "../../test/testvecs/config/detection_list.txt" perfSimConfig = ../../test/testvecs/config/import/device_config.cfg inElementType = 0 #outDataNamesList = "convolution_output,convolution_output1,convolution_output2" metaArchType = 4 metaLayersNamesList = "../../test/testvecs/models/public/onnx/yolox_s_ti_lite_metaarch.prototxt" postProcType = 2
The converted log is as follows:
./out/tidl_model_import.out ../../test/testvecs/config/import/public/onnx/tidl_import_yolox-s-ti-lite_39p1_57p9.txt
TIDL Meta PipeLine (Proto) File : ../../test/testvecs/models/public/onnx/yolox_s_ti_lite_metaarch.prototxt
yolo_v3
yolo_v3
ONNX Model (Proto) File : ../../test/testvecs/models/public/onnx/yolox-s-ti-lite_39p1_57p9.onnx
TIDL Network File : ../../test/testvecs/config/tidl_models/onnx/yolox-s-ti-lite_39p1_57p9/tidl_net_yolox-s-ti-lite_39p1_57p9.bin
TIDL IO Info File : ../../test/testvecs/config/tidl_models/onnx/yolox-s-ti-lite_39p1_57p9/tidl_io_yolox-s-ti-lite_39p1_57p9_
Current ONNX OpSet Version : 11
Error: Layer 119, :tidl_yol_od_output_layer is missing inputs in the network and cannot be topologically sorted
Input 0: 709, dataId=216
Input 1: 843, dataId=233
Input 2: 977, dataId=244
~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
Processing config file #0 : /home/ubuntu/Saicmotor/documents/gitLocal/ti-processor-sdk-rtos-j721e-evm-08_02_00_05/tidl_j721e_08_02_00_11/ti_dl/test/testvecs/config/tidl_models/onnx/yolox-s-ti-lite_39p1_57p9/tidl_import_yolox-s-ti-lite_39p1_57p9.txt.qunat_stats_config.txt
----------------------- TIDL Process with REF_ONLY FLOW ------------------------
# 0 . .. T 15940.32 .... ..... ... .... .....
~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
Processing config file #0 : /home/ubuntu/Saicmotor/documents/gitLocal/ti-processor-sdk-rtos-j721e-evm-08_02_00_05/tidl_j721e_08_02_00_11/ti_dl/test/testvecs/config/tidl_models/onnx/yolox-s-ti-lite_39p1_57p9/tidl_import_yolox-s-ti-lite_39p1_57p9.txt.qunat_stats_config.txt
----------------------- TIDL Process with REF_ONLY FLOW ------------------------
# 0 . .. T 10979.72 .... ..... ... .... .....
***************** Calibration iteration number 0 completed ************************
------------------ Network Compiler Traces -----------------------------
successful Memory allocation
INFORMATION: [TIDL_ResizeLayer] Resize_99 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
INFORMATION: [TIDL_ResizeLayer] Resize_115 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
****************************************************
** 2 WARNINGS 0 ERRORS **
****************************************************
I'm sure the paths to the relevant files are all correct.
But there were none objects detected after transform.The image is as below.
I replaced the bin files on our TDA4 EVM. The log is as below:
Scaler Init Done!
Computing checksum at 0x0000FFFFA2B32980, size = 1109840
580.414982 s: VX_ZONE_ERROR:[tivxAddKernelTIDL:259] invalid values for num_input_tensors or num_output_tensors
580.415011 s: VX_ZONE_ERROR:[vxGetStatus:713] Reference is NULL
TIDL Init Done!
App Init Done!
App Run Graph Done!
580.415057 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
580.415068 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
App Delete Graph Done!
Input image release Done!
Scaler deinit Done!
580.415167 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
Pre-Proc deinit Done!
TIDL deinit Done!
580.415312 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
580.415320 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
Draw detections deinit Done!
580.415336 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
580.415344 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
580.415351 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
Mosaic deinit Done!
580.415366 s: VX_ZONE_ERROR:[ownReleaseReferenceInt:307] Invalid reference
Display deinit Done!
Graphics deinit Done!
TIDL unload Done!
ImgProc unload Done!
HWA unload Done!
580.415668 s: VX_ZONE_WARNING:[vxReleaseContext:1050] Found a reference 0xffffaee2c180 of type 0000080f at external count 1, internal count 0, releasing it
580.415679 s: VX_ZONE_WARNING:[vxReleaseContext:1052] Releasing reference (name=image_97) now as a part of garbage collection
580.415689 s: VX_ZONE_WARNING:[vxReleaseContext:1050] Found a reference 0xffffaee2c438 of type 0000080f at external count 1, internal count 0, releasing it
580.415698 s: VX_ZONE_WARNING:[vxReleaseContext:1052] Releasing reference (name=image_98) now as a part of garbage collection
580.415710 s: VX_ZONE_WARNING:[vxReleaseContext:1050] Found a reference 0xffffaee2cc60 of type 0000080f at external count 1, internal count 0, releasing it
580.415718 s: VX_ZONE_WARNING:[vxReleaseContext:1052] Releasing reference (name=image_103) now as a part of garbage collection
Context released!
App De-init Done!
580.415822 s: VX_ZONE_INIT:[tivxHostDeInitLocal:100] De-Initialization Done for HOST !!!
580.420203 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 10664116 bytes
MEM: Free's : 8 free's of 10664116 bytes
MEM: Open's : 0 allocs of 0 bytes
MEM: Deinit ... Done !!!
APP: Deinit ... Done
So could you help us to solve this problem.
Tks a lot !
metaArchType for YOLOX should be 6
See these examples:
https://github.com/TexasInstruments/edgeai-benchmark/blob/master/scripts/benchmark_custom.py#L245
https://github.com/TexasInstruments/edgeai-benchmark/blob/master/configs/detection.py#L312
Also make sure the prototxt is correct:
Hello Manu :
I downloaded the yolox_s_lite_640x640_20220221_model.prototxt and yolox_s_lite_640x640_20220221_model.onnx from the url https://github.com/TexasInstruments/edgeai-modelzoo/blob/master/models/vision/detection/coco/edgeai-mmdet
I also copide these two files to our 0802 SDK for onnx to bin files transforming.
I've modified the metaArchType to 6 .
And the cmd is : ./out/tidl_model_import.out ../../test/testvecs/config/import/public/onnx/tidl_import_yolox_s_lite_640x640_20220221_model.txt
The file tidl_import_yolox_s_lite_640x640_20220221_model.txt is as below.
modelType = 2 numParamBits = 8 numFeatureBits = 8 quantizationStyle = 3 #quantizationStyle = 2 inputNetFile = "../../test/testvecs/models/public/onnx/yolox_s_lite_640x640_20220221_model.onnx" outputNetFile = "../../test/testvecs/config/tidl_models/onnx/yolox_s_lite_640x640_20220221_model/tidl_net_yolox_s_lite_640x640_20220221_model.bin" outputParamsFile = "../../test/testvecs/config/tidl_models/onnx/yolox_s_lite_640x640_20220221_model/tidl_io_yolox_s_lite_640x640_20220221_model_" inDataNorm = 1 inMean = 0 0 0 inScale = 0.003921568627 0.003921568627 0.003921568627 inDataFormat = 1 inWidth = 640 inHeight = 640 inNumChannels = 3 numFrames = 1 inData = "../../test/testvecs/config/detection_list.txt" perfSimConfig = ../../test/testvecs/config/import/device_config.cfg inElementType = 0 #outDataNamesList = "convolution_output,convolution_output1,convolution_output2" metaArchType = 6 metaLayersNamesList = "../../test/testvecs/models/public/onnx/yolox_s_lite_640x640_20220221_model.prototxt" postProcType = 2
The log is as follows :
./out/tidl_model_import.out ../../test/testvecs/config/import/public/onnx/tidl_import_yolox_s_lite_640x640_20220221_model.txt
TIDL Meta PipeLine (Proto) File : ../../test/testvecs/models/public/onnx/yolox_s_lite_640x640_20220221_model.prototxt
yolox
yolox
ONNX Model (Proto) File : ../../test/testvecs/models/public/onnx/yolox_s_lite_640x640_20220221_model.onnx
TIDL Network File : ../../test/testvecs/config/tidl_models/onnx/yolox_s_lite_640x640_20220221_model/tidl_net_yolox_s_lite_640x640_20220221_model.bin
TIDL IO Info File : ../../test/testvecs/config/tidl_models/onnx/yolox_s_lite_640x640_20220221_model/tidl_io_yolox_s_lite_640x640_20220221_model_
Current ONNX OpSet Version : 11
~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
Processing config file #0 : /home/ubuntu/Saicmotor/documents/gitLocal/ti-processor-sdk-rtos-j721e-evm-08_02_00_05/tidl_j721e_08_02_00_11/ti_dl/test/testvecs/config/tidl_models/onnx/yolox_s_lite_640x640_20220221_model/tidl_import_yolox_s_lite_640x640_20220221_model.txt.qunat_stats_config.txt
----------------------- TIDL Process with REF_ONLY FLOW ------------------------
# 0 . .. T 15352.02 .... ..... ... .... .....
~~~~~Running TIDL in PC emulation mode to collect Activations range for each layer~~~~~
Processing config file #0 : /home/ubuntu/Saicmotor/documents/gitLocal/ti-processor-sdk-rtos-j721e-evm-08_02_00_05/tidl_j721e_08_02_00_11/ti_dl/test/testvecs/config/tidl_models/onnx/yolox_s_lite_640x640_20220221_model/tidl_import_yolox_s_lite_640x640_20220221_model.txt.qunat_stats_config.txt
----------------------- TIDL Process with REF_ONLY FLOW ------------------------
# 0 . .. T 10335.50 .... ..... ... .... .....
***************** Calibration iteration number 0 completed ************************
------------------ Network Compiler Traces -----------------------------
successful Memory allocation
INFORMATION: [TIDL_ResizeLayer] Resize_98 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
INFORMATION: [TIDL_ResizeLayer] Resize_114 Any resize ratio which is power of 2 and greater than 4 will be placed by combination of 4x4 resize layer and 2x2 resize layer. For example a 8x8 resize will be replaced by 4x4 resize followed by 2x2 resize.
****************************************************
** 2 WARNINGS 0 ERRORS **
****************************************************
But the generated image is still empty.(image name tidl_import_yolox_s_lite_640x640_20220221_model.txt_stats_tool_out.bin_ti_lindau_000020.bmp_000000_tidl_post_proc2.png)
I am confused.
To debug, you can set
numParamBits = 32
numFeatureBits = 32
and see if it works in the float simulation mode.
This should be the first step if a model doesn't work. Float simulation mode will not work in EVM.
If it works in float simulation mode, you can try 16 bit mode and see if it works in PC and EVM.
If it works in the float simulation mode and 16 bit, but doesn't work in 8 bit mode, then the problem is due to quantization error.
(It's quite possible because your numFrames = 1 and you are not setting calibrationOption)
In 8 bit mode import , suggest setting numFrames = 50 and calibrationOption = 7
Hello Yang Chao:
I have tried several times without success.
Can you show me your tidl_import_************.txt file?
Like "./out/tidl_model_import.out ../../test/testvecs/config/import/public/onnx/tidl_import_yolox_s_lite_640x640_20220221_model.txt"
PS: Hi Manu
I followed your advice and it didn't work either.
Have you seen this? Is this the one that you are looking for?
test/testvecs/config/import/internal/onnx/tidl_import_yolox_s_ti_lite.txt
Hello Manu:
I searched for this file in 0802 SDK\EDGEAI-modelzoo\edgeai-yolox path.
But there is no such file.
Can you give me the url of this file?
Thanks !
Which file? Do you mean the import config file: test/testvecs/config/import/internal/onnx/tidl_import_yolox_s_ti_lite.txt
It is supposed to be in TIDL release inside PSDK-RTOS. But since it is in the internal folder, I realize it may not be part of the release.
Hello Manu:
I have solved my problem.
There are several parameters of the impoter file that need to be modified.
quantizationStyle = 3
inScale = 1.0 1.0 1.0
metaArchType = 6
And the impoter for yolox file is as below :
modelType = 2
numParamBits = 8
numFeatureBits = 8
quantizationStyle = 3
inputNetFile = "../../test/testvecs/models/public/onnx/yolox_m_ti_lite_45p5_64p2.onnx"
outputNetFile = "../../test/testvecs/config/tidl_models/onnx/yolox_m_ti_lite_45p5_64p2/tidl_net_yolox_m_ti_lite_45p5_64p2.bin"
outputParamsFile = "../../test/testvecs/config/tidl_models/onnx/yolox_m_ti_lite_45p5_64p2/tidl_io_yolox_m_ti_lite_45p5_64p2_"
inDataNorm = 1
inMean = 0 0 0
inScale = 1.0 1.0 1.0
inDataFormat = 1
inWidth = 640
inHeight = 640
inNumChannels = 3
numFrames = 1
inData = "../../test/testvecs/config/detection_list.txt"
perfSimConfig = ../../test/testvecs/config/import/device_config.cfg
inElementType = 0
#outDataNamesList = "convolution_output,convolution_output1,convolution_output2"
metaArchType = 6
metaLayersNamesList = "../../test/testvecs/models/public/onnx/yolox_m_ti_lite_metaarch.prototxt"
postProcType = 2
And the url of the TI yolox onnx is :TI yolox onnx and prototxt
Also , I post a thread in our forum. Click hereYolox run On TDA4 EVM
Good luck !