Reshape error in ssd_mobilent_v3 object detection model in TensorflowLite Micro

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reshape error in ssd_mobilent_v3 object detection model in TensorflowLite Micro

Jump to solution
4,818 Views
Ramson
Contributor IV

Hi team,

We have trained the object detection model on VOC dataset using eIQ toolkit and exported the model as .tflite file which I have attached below. When running the model on RT1170EVK. We're facing an error in the reshape operator as shown below:

.reshape.cpp:70 num_input_elements != num_output_elements (126 != 21)
.reshape.cpp:70 num_input_elements != num_output_elements (126 != 21)
.reshape.cpp:77 ReshapeOutput(context, node) != kTfLiteOk (1 != 0)
Node RESHAPE (number 147f) failed to prepare with status 1
AllocateTensors() failed
Failed initializing model

When we looked into the model using model tool, we think this is the node.

Ramson_0-1631007555333.png

How to solve this error? Please guide us. Thanks in Advance.

 

Regards,

Ramson Jehu K

0 Kudos
1 Solution
4,749 Views
anthony_huereca
NXP Employee
NXP Employee

Hi Ramson,

  The root cause is an issue in the TFLite conversion step when exporting the model as a .tflite file. It makes use of the TensorFlow tools and this bug has now been logged in the Tensorflow github: https://github.com/tensorflow/tensorflow/issues/52028 

 

  In the meantime, if not tried already, try using the TOCO converter which may be able to avoid this issue.  You can also try using the DVRT inference engine so you don't have to go through the conversion step with the model. 

-Anthony 

View solution in original post

4 Replies
4,792 Views
anthony_huereca
NXP Employee
NXP Employee

Hi Ramson,
  We were able to recreate the error with your model and our development team is working on a fix. I'll provide an update when I have more information. 

-Anthony 

0 Kudos
4,766 Views
Ramson
Contributor IV

Thanks Anthony, waiting for your response only.

0 Kudos
4,750 Views
anthony_huereca
NXP Employee
NXP Employee

Hi Ramson,

  The root cause is an issue in the TFLite conversion step when exporting the model as a .tflite file. It makes use of the TensorFlow tools and this bug has now been logged in the Tensorflow github: https://github.com/tensorflow/tensorflow/issues/52028 

 

  In the meantime, if not tried already, try using the TOCO converter which may be able to avoid this issue.  You can also try using the DVRT inference engine so you don't have to go through the conversion step with the model. 

-Anthony 

4,737 Views
Ramson
Contributor IV

Hi Anthony, 

Thank you so much for the insights that you have provided. Sure I will try using TOCO convertor and check. 

I'm also kinda stuck with the output interpretation which i have mentioned here : https://community.nxp.com/t5/eIQ-Machine-Learning-Software/What-is-the-output-signature-of-the-ssd-m... . It would be a great help if you could get us through it.

Thanks in Advance

Ramson

0 Kudos