int8-Quantization for MobileNet V2 and i.MX 8M Plus

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

int8-Quantization for MobileNet V2 and i.MX 8M Plus

1,612 Views
HyTa
Contributor I

Hi,

i have a problem with my quantizied tflite-model of ssd_mobilenetv2 . I want to detect persons on the i.MX 8M Plus and therefore i need a full integer quantized tflite model.

 

Testing my object detection code on the NPU of the i.MX8M Plus the inference time is very good, but the detection is very bad. For example i have tested it on the GPU with different images and all images has the same boxes and scores. And therefore the boxes are wrong,too. (see images below)

 

 

Thanks for your help

0 Kudos
Reply
2 Replies

1,576 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

How you got the model (whether downloaded pre-rained model, or created their own model)? I have tried to get similar model from eIQ, but gives just 2 tensors as outout. I want to simulate the same process, so I need to know process how they create the model with 3 tensors output.

Also can be interesting for you: There is example in eIQ Toolkit (download [1]) in path \workspace\models\mobilenet_ssd_v2 - how to use SSD mobilenetv2 to detect objects.

Zdenek

[1] https://www.nxp.com/design/software/development-software/eiq-ml-development-environment/eiq-toolkit-...

Regards

0 Kudos
Reply

1,556 Views
HyTa
Contributor I

I have solved my problem. The important step are two lines in the quantization. I want to have the fully int8 quantization, but my input and outputs must be choosen as float32 instead of int8.

Follow this page

https://towardsdatascience.com/quantize-your-deep-learning-model-to-run-on-an-npu-2900191757e5