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.

Error in compiling ONNX model



Hi,

I'm trying to compile an ONNX model using TIDL tools 08_05_00_00 (see the attached structure) and got the following error:

tidl_tools_path                                 = /opt/tidl_tools
artifacts_folder                                = /data/michlit/work_data/tidl_convert/compiled_models/fvp_standalone_shared_conv_opset_11_08_05_rnd_1_iter_3
tidl_tensor_bits                                = 16
debug_level                                     = 3
num_tidl_subgraphs                              = 16
tidl_denylist                                   =
tidl_denylist_layer_name                        =
tidl_denylist_layer_type                         =
model_type                                      =  
tidl_calibration_accuracy_level                 = 7
tidl_calibration_options:num_frames_calibration = 1
tidl_calibration_options:bias_calibration_iterations = 3
mixed_precision_factor = -1.000000
model_group_id = 0
power_of_2_quantization                         = 2
enable_high_resolution_optimization             = 0
pre_batchnorm_fold                              = 1
add_data_convert_ops                          = 0
output_feature_16bit_names_list                 =  
m_params_16bit_names_list                       =  
reserved_compile_constraints_flag               = 1601
ti_internal_reserved_1                          =

 ****** WARNING : Network not identified as Object Detection network : (1) Ignore if network is not Object Detection network (2) If network is Object Detection network, please specify "model_type":"OD" as part of OSRT compilation options******

Supported TIDL layer type ---        Identity -- Identity_27
Supported TIDL layer type ---         MaxPool -- /layers.0/layers.0.0/MaxPool
Supported TIDL layer type ---            Conv -- /layers.0/layers.0.1/Conv
Supported TIDL layer type ---            Relu -- /layers.0/layers.0.3/Relu
Supported TIDL layer type ---            Conv -- /layers.0/layers.0.4/Conv
Supported TIDL layer type ---            Relu -- /layers.0/layers.0.6/Relu
Supported TIDL layer type ---            Conv -- /layers.0/layers.0.4_1/Conv
Supported TIDL layer type ---            Relu -- /layers.0/layers.0.9/Relu
Unsupported (TIDL check) TIDL layer type ---         MaxPool
Supported TIDL layer type ---            Conv -- /layers.1/layers.1.1/Conv
Supported TIDL layer type ---            Relu -- /layers.1/layers.1.3/Relu
Supported TIDL layer type ---            Conv -- /layers.1/layers.1.4/Conv
Supported TIDL layer type ---            Relu -- /layers.1/layers.1.6/Relu
Supported TIDL layer type ---            Conv -- /layers.1/layers.1.4_1/Conv
Supported TIDL layer type ---            Relu -- /layers.1/layers.1.9/Relu
Unsupported (TIDL check) TIDL layer type ---         MaxPool
Supported TIDL layer type ---            Conv -- /layers.2/layers.2.1/Conv
Supported TIDL layer type ---            Relu -- /layers.2/layers.2.3/Relu
Supported TIDL layer type ---            Conv -- /layers.2/layers.2.4/Conv
Supported TIDL layer type ---            Relu -- /layers.2/layers.2.6/Relu
Supported TIDL layer type ---            Conv -- /layers.2/layers.2.4_1/Conv
Supported TIDL layer type ---            Relu -- /layers.2/layers.2.9/Relu

Preliminary subgraphs created = 3
Final number of subgraphs created are : 3, - Offloaded Nodes - 20, Total Nodes - 22
ALLOWLISTING : POOLING layer : Number of input dimensions must be 4  --  file info - tidl_import_common_model_check.cpp , TIDL_checkPoolingTensorProperties , 459  
ALLOWLISTING : POOLING layer : Number of input dimensions must be 4  --  file info - tidl_import_common_model_check.cpp , TIDL_checkPoolingTensorProperties , 459  
Running runtimes graphviz - /opt/tidl_tools/tidl_graphVisualiser_runtimes.out /data/michlit/work_data/tidl_convert/compiled_models/fvp_standalone_shared_conv_opset_11_08_05_rnd_1_iter_3/allowedNode.txt /data/michlit/work_data/tidl_convert/compiled_models/fvp_standalone_shared_conv_opset_11_08_05_rnd_1_iter_3/tempDir/graphvizInfo.txt /data/michlit/work_data/tidl_convert/compiled_models/fvp_standalone_shared_conv_opset_11_08_05_rnd_1_iter_3/tempDir/runtimes_visualization.svg
Traceback (most recent call last):
  File "/data/michlit/code/Perception/autonomy/apps/lane_detection/tidl/tidl_convert.py", line 399, in <module>
    main()
  File "/data/michlit/code/Perception/autonomy/apps/lane_detection/tidl/tidl_convert.py", line 384, in main
    input_shape=input_shape, calibration_frames=calibration_frames)
  File "/data/michlit/code/Perception/autonomy/apps/lane_detection/tidl/tidl_convert.py", line 156, in compile_model
    compile_options, {}], sess_options=so)
  File "/usr/local/lib/python3.6/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 283, in __init__
    self._create_inference_session(providers, provider_options)
  File "/usr/local/lib/python3.6/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 315, in _create_inference_session
    sess.initialize_session(providers, provider_options)
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : This is an invalid model. Error: Duplicate definition of name (feature_f1).

There is no duplicate names in the model, "feature_f1" is one of the model outputs.

The compilation options I pass:

{
  'tidl_tools_path': '/opt/tidl_tools',
  'artifacts_folder': <path/to/artifact/folder>,
  'tensor_bits': 16,
  'accuracy_level': 1,
  'advanced_options:calibration_frames': 1,
  'advanced_options:calibration_iterations': 3,
  'debug_level': 3,
  'deny_list': '',
  'max_num_subgraphs': 16
}

The other question for the same model - why does the TIDL compiler issues warnings on 2 of 3 MaxPool layers - the input dimensions for all 3 MaxPool layers is 4:

ALLOWLISTING : POOLING layer : Number of input dimensions must be 4  --  file info - tidl_import_common_model_check.cpp , TIDL_checkPoolingTensorProperties , 459  

Please advice.

Thanks.