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: segmentation fault when model import using tidl tools

Part Number: TDA4VM


Tool/software:

Hello, I'm trying to import custom model using edgeai-tidl-tools.

My model looks llike below image.

And i got error message like this

root@5fcd978baa80:/home/root/examples/osrt_python/tfl# python3 tflrt_delegate.py -c
Running 1 Models - ['dimension_test']


Running_Model :  dimension_test
delegate setting start
tidl_tools_path                                 = /home/root/tidl_tools 
artifacts_folder                                = ../../../custom_model/artifacts/dimension_test/ 
tidl_tensor_bits                                = 8 
debug_level                                     = 5 
num_tidl_subgraphs                              = 16 
tidl_denylist                                   = 
tidl_denylist_layer_name                        = 
tidl_denylist_layer_type                        = 
tidl_allowlist_layer_name                       = 
model_type                                      =  
tidl_calibration_accuracy_level                 = 7 
tidl_calibration_options:num_frames_calibration = 5 
tidl_calibration_options:bias_calibration_iterations = 3 
mixed_precision_factor = -1.000000 
model_group_id = 0 
power_of_2_quantization                         = 3 
ONNX QDQ Enabled                                = 0 
enable_high_resolution_optimization             = 0 
pre_batchnorm_fold                              = 0 
add_data_convert_ops                            = 3 
output_feature_16bit_names_list                 =  
m_params_16bit_names_list                       =  
m_single_core_layers_names_list                 =  
Inference mode                                  = 0 
Number of cores                                 = 1 
reserved_compile_constraints_flag               = 1601 
partial_init_during_compile                     = 0 
ti_internal_reserved_1                          = 

delegate setting fin!
Model path :  ../../../custom_model/model/new_prelu_to_mul_cut5.tflite
compile mode!
========================= [Model Compilation Started] =========================

Model compilation will perform the following stages:
1. Parsing
2. Graph Optimization
3. Quantization & Calibration
4. Memory Planning

============================== [Version Summary] ==============================

-------------------------------------------------------------------------------
|          TIDL Tools Version          |              10_00_04_00             |
-------------------------------------------------------------------------------
|         C7x Firmware Version         |              10_00_02_00             |
-------------------------------------------------------------------------------

============================== [Parsing Started] ==============================

[TIDL Import] [PARSER] 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
[TIDL Import] [PARSER] SUPPORTED: Supported TIDL layer type --- 1 Tflite layer type --- 3 layer output name--- model_5/model_4/model_3/batch_normalization_132/FusedBatchNormV3;model_5/model_4/model_3/conv2d_81/BiasAdd/ReadVariableOp/resource;model_5/model_4/model_3/conv2d_81/BiasAdd;model_5/model_4/model_3/depthwise_conv2d_68/depthwise;model_5/model_4/model_3/conv2d_81/Conv2D  -- [tidl_tfLiteRtImport_core.cpp, 3090]
[TIDL Import] [PARSER] SUPPORTED: Supported TIDL layer type --- 5 Tflite layer type --- 18 layer output name--- customed_output_first  -- [tidl_tfLiteRtImport_core.cpp, 3090]
[TIDL Import] [PARSER] SUPPORTED: Supported TIDL layer type --- 5 Tflite layer type --- 18 layer output name--- customed_output_third  -- [tidl_tfLiteRtImport_core.cpp, 3090]
[TIDL Import] [PARSER] SUPPORTED: Supported TIDL layer type --- 3 Tflite layer type --- 19 layer output name--- customed_output_fourth  -- [tidl_tfLiteRtImport_core.cpp, 3090]
[TIDL Import] [PARSER] SUPPORTED: Supported TIDL layer type --- 5 Tflite layer type --- 0 layer output name--- model_5/model_4/model_3/p_re_lu_126/add;model_5/model_4/model_3/p_re_lu_126/Relu;model_5/model_4/model_3/p_re_lu_126/Neg_1;model_5/model_4/model_3/p_re_lu_126/Relu_1;model_5/model_4/model_3/p_re_lu_126/mul1  -- [tidl_tfLiteRtImport_core.cpp, 3090]
[TIDL Import] [PARSER] SUPPORTED: Supported TIDL layer type --- 1 Tflite layer type --- 3 layer output name--- model_5/model_4/model_3/batch_normalization_133/FusedBatchNormV3;model_5/model_4/model_3/depthwise_conv2d_63/depthwise;model_5/model_4/model_3/conv2d_82/Conv2D  -- [tidl_tfLiteRtImport_core.cpp, 3090]
[TIDL Import] [PARSER] SUPPORTED: Supported TIDL layer type --- 5 Tflite layer type --- 18 layer output name--- customed_output_first  -- [tidl_tfLiteRtImport_core.cpp, 3090]

Total Nodes = 7
-------------------------------------------------------------------------------
|          Core           |      No. of Nodes       |   Number of Subgraphs   |
-------------------------------------------------------------------------------
| C7x                     |                       7 |                       1 |
| CPU                     |                       0 |                       x |
-------------------------------------------------------------------------------
============================= [Parsing Completed] =============================

In TIDL_tfliteRtImportInit subgraph_id=490
Layer 0, subgraph id 490, name=customed_output_first
Layer 1, subgraph id 490, name=input_12
In TIDL_tfliteRtImportNode, TIDL Layer type - 1, Tflite builtin code type - 3 
In TIDL_tfliteRtImportNode, TIDL Layer type - 5, Tflite builtin code type - 18 
In TIDL_tfliteRtImportNode, TIDL Layer type - 5, Tflite builtin code type - 18 
In TIDL_tfliteRtImportNode, TIDL Layer type - 3, Tflite builtin code type - 19 
In TIDL_tfliteRtImportNode, TIDL Layer type - 5, Tflite builtin code type - 0 
In TIDL_tfliteRtImportNode, TIDL Layer type - 1, Tflite builtin code type - 3 
In TIDL_tfliteRtImportNode, TIDL Layer type - 5, Tflite builtin code type - 18 
=================== [Optimization for subgraph_490 started] ===================

In TIDL_runtimesOptimizeNet: LayerIndex = 9, dataIndex = 8 
[TIDL Import] [PARSER] WARNING: Batch Norm Layer customed_output_third's coeff cannot be found(or not match) in coeff file, Random bias will be generated only for evaluation usage. Results are all random

[TIDL Import]  ERROR:  - Failed in function: tidl_optimizeNet -- [tidl_import_core.cpp, 2473]
[TIDL Import]  ERROR: Network Optimization failed - Failed in function: TIDL_runtimesOptimizeNet -- [tidl_runtimes_import_common.cpp, 1232]
interpreter created!
batch :  1 new_height :  256 new_width :  256 channel :  3
Segmentation fault (core dumped)

1. How can i solve this error?

2. How can I find the "tidl_import_core.cpp" or "itdl_runtimes_import_common.cpp" or the orignal src file of "tidl_model_import_tflite.so"?

thank you.