Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All the Input Tensor Dimensions has to be greater then Zero ** DIM Error - For Tensor 20, Dim 3 is -1 #95

Open
tewa-naggi opened this issue Nov 20, 2024 · 0 comments

Comments

@tewa-naggi
Copy link

tewa-naggi commented Nov 20, 2024

I encountered this error when compiling my custom LSTM model. Is there any way to locate the wrong dim tensor which is "Tensor 20" in the code? And how should i fix this? (The version of tidl tools is 09_01_06_00)
Here is the log after running my compile script:

tidl_tools_path                                 = ../../tidl_tools 
artifacts_folder                                = artifacts 
tidl_tensor_bits                                = 8 
debug_level                                     = 2 
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 = 12 
tidl_calibration_options:bias_calibration_iterations = 12 
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                              = 1 
add_data_convert_ops                          = 3 
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 ---          Gather -- /Gather 
Supported TIDL layer type ---            Gemm -- /Wc/Gemm 
Supported TIDL layer type ---             Add -- /Add_3 
Supported TIDL layer type ---            Tanh -- /Tanh 
Supported TIDL layer type ---             Add -- /Add 
Supported TIDL layer type ---         Sigmoid -- /Sigmoid 
Supported TIDL layer type ---             Mul -- /Mul_1 
Supported TIDL layer type ---             Add -- /Add_1 
Supported TIDL layer type ---         Sigmoid -- /Sigmoid_1 
Supported TIDL layer type ---             Mul -- /Mul 
Supported TIDL layer type ---             Add -- /Add_4 
Supported TIDL layer type ---            Tanh -- /Tanh_1 
Supported TIDL layer type ---             Add -- /Add_2 
Supported TIDL layer type ---         Sigmoid -- /Sigmoid_2 
Supported TIDL layer type ---             Mul -- /Mul_2 
Supported TIDL layer type ---          MatMul -- /Uc_1/MatMul 
Supported TIDL layer type ---             Add -- /Uc_1/Add 
Supported TIDL layer type ---          Gather -- /Gather_1 
Supported TIDL layer type ---            Gemm -- /Wc_1/Gemm 
Supported TIDL layer type ---             Add -- /Add_8 
Supported TIDL layer type ---            Tanh -- /Tanh_2 
Supported TIDL layer type ---         Sigmoid -- /Sigmoid_3 
Supported TIDL layer type ---             Mul -- /Mul_4 
Supported TIDL layer type ---             Mul -- /Mul_3 
Supported TIDL layer type ---             Add -- /Add_9 
Supported TIDL layer type ---            Tanh -- /Tanh_3 
Supported TIDL layer type ---             Mul -- /Mul_5 
Supported TIDL layer type ---          MatMul -- /Uc_2/MatMul 
Supported TIDL layer type ---             Add -- /Uc_2/Add 
Supported TIDL layer type ---          Gather -- /Gather_2 
Supported TIDL layer type ---            Gemm -- /Wc_2/Gemm 
Supported TIDL layer type ---             Add -- /Add_13 
Supported TIDL layer type ---            Tanh -- /Tanh_4 
Supported TIDL layer type ---         Sigmoid -- /Sigmoid_6 
Supported TIDL layer type ---             Mul -- /Mul_7 
Supported TIDL layer type ---             Mul -- /Mul_6 
Supported TIDL layer type ---             Add -- /Add_14 
Supported TIDL layer type ---            Tanh -- /Tanh_5 
Supported TIDL layer type ---             Mul -- /Mul_8 
Supported TIDL layer type ---          MatMul -- /Uc_3/MatMul 
Supported TIDL layer type ---             Add -- /Uc_3/Add 
Supported TIDL layer type ---          Gather -- /Gather_3 
Supported TIDL layer type ---            Gemm -- /Wc_3/Gemm 
Supported TIDL layer type ---             Add -- /Add_18 
Supported TIDL layer type ---            Tanh -- /Tanh_6 
Supported TIDL layer type ---         Sigmoid -- /Sigmoid_9 
Supported TIDL layer type ---             Mul -- /Mul_10 
Supported TIDL layer type ---             Mul -- /Mul_9 
Supported TIDL layer type ---             Add -- /Add_19 
Supported TIDL layer type ---            Tanh -- /Tanh_7 
Supported TIDL layer type ---             Mul -- /Mul_11 
Supported TIDL layer type ---          Concat -- /Concat 

Preliminary subgraphs created = 1 
Final number of subgraphs created are : 1, - Offloaded Nodes - 52, Total Nodes - 52 
Running runtimes graphviz - ../../tidl_tools/tidl_graphVisualiser_runtimes.out artifacts/allowedNode.txt artifacts/tempDir/graphvizInfo.txt artifacts/tempDir/runtimes_visualization.svg 
*** In TIDL_createStateImportFunc *** 
Compute on node : TIDLExecutionProvider_TIDL_0_0
  0,          Gather, 2, 1, input, /Gather_3_output_0
  1,            Gemm, 3, 1, /Gather_3_output_0, /Wc_3/Gemm_output_0
  2,          Gather, 2, 1, input, /Gather_2_output_0
  3,            Gemm, 3, 1, /Gather_2_output_0, /Wc_2/Gemm_output_0
  4,          Gather, 2, 1, input, /Gather_1_output_0
  5,            Gemm, 3, 1, /Gather_1_output_0, /Wc_1/Gemm_output_0
  6,          Gather, 2, 1, input, /Gather_output_0
  7,            Gemm, 3, 1, /Gather_output_0, /Wc/Gemm_output_0
  8,             Add, 2, 1, /Wc/Gemm_output_0, /Add_2_output_0
  9,         Sigmoid, 1, 1, /Add_2_output_0, /Sigmoid_2_output_0
 10,             Add, 2, 1, /Wc/Gemm_output_0, /Add_1_output_0
 11,         Sigmoid, 1, 1, /Add_1_output_0, /Sigmoid_1_output_0
 12,             Mul, 2, 1, /Sigmoid_1_output_0, /Mul_output_0
 13,             Add, 2, 1, /Wc/Gemm_output_0, /Add_output_0
 14,         Sigmoid, 1, 1, /Add_output_0, /Sigmoid_output_0
 15,             Add, 2, 1, /Wc/Gemm_output_0, /Add_3_output_0
 16,            Tanh, 1, 1, /Add_3_output_0, /Tanh_output_0
 17,             Mul, 2, 1, /Sigmoid_output_0, /Mul_1_output_0
 18,             Add, 2, 1, /Mul_output_0, /Add_4_output_0
 19,            Tanh, 1, 1, /Add_4_output_0, /Tanh_1_output_0
 20,             Mul, 2, 1, /Sigmoid_2_output_0, /Mul_2_output_0
 21,          MatMul, 2, 1, /Mul_2_output_0, /Uc_1/MatMul_output_0
 22,             Add, 2, 1, Wi.bias, /Uc_1/Add_output_0
 23,             Add, 2, 1, /Wc_1/Gemm_output_0, /Add_8_output_0
 24,         Sigmoid, 1, 1, /Add_8_output_0, /Sigmoid_3_output_0
 25,             Mul, 2, 1, /Sigmoid_3_output_0, /Mul_3_output_0
 26,            Tanh, 1, 1, /Add_8_output_0, /Tanh_2_output_0
 27,             Mul, 2, 1, /Sigmoid_3_output_0, /Mul_4_output_0
 28,             Add, 2, 1, /Mul_3_output_0, /Add_9_output_0
 29,            Tanh, 1, 1, /Add_9_output_0, /Tanh_3_output_0
 30,             Mul, 2, 1, /Sigmoid_3_output_0, /Mul_5_output_0
 31,          MatMul, 2, 1, /Mul_5_output_0, /Uc_2/MatMul_output_0
 32,             Add, 2, 1, Wi.bias, /Uc_2/Add_output_0
 33,             Add, 2, 1, /Wc_2/Gemm_output_0, /Add_13_output_0
 34,         Sigmoid, 1, 1, /Add_13_output_0, /Sigmoid_6_output_0
 35,             Mul, 2, 1, /Sigmoid_6_output_0, /Mul_6_output_0
 36,            Tanh, 1, 1, /Add_13_output_0, /Tanh_4_output_0
 37,             Mul, 2, 1, /Sigmoid_6_output_0, /Mul_7_output_0
 38,             Add, 2, 1, /Mul_6_output_0, /Add_14_output_0
 39,            Tanh, 1, 1, /Add_14_output_0, /Tanh_5_output_0
 40,             Mul, 2, 1, /Sigmoid_6_output_0, /Mul_8_output_0
 41,          MatMul, 2, 1, /Mul_8_output_0, /Uc_3/MatMul_output_0
 42,             Add, 2, 1, Wi.bias, /Uc_3/Add_output_0
 43,             Add, 2, 1, /Wc_3/Gemm_output_0, /Add_18_output_0
 44,         Sigmoid, 1, 1, /Add_18_output_0, /Sigmoid_9_output_0
 45,             Mul, 2, 1, /Sigmoid_9_output_0, /Mul_9_output_0
 46,            Tanh, 1, 1, /Add_18_output_0, /Tanh_6_output_0
 47,             Mul, 2, 1, /Sigmoid_9_output_0, /Mul_10_output_0
 48,             Add, 2, 1, /Mul_9_output_0, /Add_19_output_0
 49,            Tanh, 1, 1, /Add_19_output_0, /Tanh_7_output_0
 50,             Mul, 2, 1, /Sigmoid_9_output_0, /Mul_11_output_0
 51,          Concat, 4, 1, /Mul_2_output_0, 146

Input tensor name -  input 
Output tensor name - 146 
 Graph Domain TO version : 11In TIDL_onnxRtImportInit subgraph_name=146
Layer 0, subgraph id 146, name=146
Layer 1, subgraph id 146, name=input
In TIDL_runtimesOptimizeNet: LayerIndex = 54, dataIndex = 53 
****************************************************
**   All the Input Tensor Dimensions has to be greater then Zero 
**   DIM Error - For Tensor 20, Dim 3 is -1
****************************************************

Here is the code of my model and compilation script.
lstm_linear_implement.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant