Post Quantization Model Runs on iMX93 NPU, but Output is Incorrect

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

Post Quantization Model Runs on iMX93 NPU, but Output is Incorrect

1,131 Views
Skramer
Contributor I

I am working with a custom implementation of MobileNet designed to do binary classification on sparks. After converting to tflite and quantizing it to int8, the model runs on the NPU as expected, but the output does not make sense. The model had good accuracy before quantization, but the int8 outputs seem to be totally random. After testing on some of the training data, frames that should be positive are ranging from -128 to 127, and so are frames that should have been negative. Am I misinterpreting the output, or did something go wrong while converting or quantizing the model?

0 Kudos
Reply
5 Replies

1,079 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

Please provide the model and which BSP are you testing?

Regards

0 Kudos
Reply

1,025 Views
Skramer
Contributor I

Hello,

I have attached the model. The BSP is Linux BSP. 

Thanks

0 Kudos
Reply

1,015 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Your model can run with the latest BSP, it uses GPU besides the performance it run very well, I can not see any error.

 

Regards 

0 Kudos
Reply

1,013 Views
Skramer
Contributor I

Would you mind sharing the script you used to successfully run it? Perhaps I have written my script incorrectly.

Thanks

0 Kudos
Reply

987 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Here is attached!!

Regards

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2186805%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EPost%20Quantization%20Model%20Runs%20on%20iMX93%20NPU%2C%20but%20Output%20is%20Incorrect%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2186805%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20working%20with%20a%20custom%20implementation%20of%20MobileNet%20designed%20to%20do%20binary%20classification%20on%20sparks.%20After%20converting%20to%20tflite%20and%20quantizing%20it%20to%20int8%2C%20the%20model%20runs%20on%20the%20NPU%20as%20expected%2C%20but%20the%20output%20does%20not%20make%20sense.%20The%20model%20had%20good%20accuracy%20before%20quantization%2C%20but%20the%20int8%20outputs%20seem%20to%20be%20totally%20random.%20After%20testing%20on%20some%20of%20the%20training%20data%2C%20frames%20that%20should%20be%20positive%20are%20ranging%20from%20-128%20to%20127%2C%20and%20so%20are%20frames%20that%20should%20have%20been%20negative.%20Am%20I%20misinterpreting%20the%20output%2C%20or%20did%20something%20go%20wrong%20while%20converting%20or%20quantizing%20the%20model%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2190896%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Post%20Quantization%20Model%20Runs%20on%20iMX93%20NPU%2C%20but%20Output%20is%20Incorrect%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2190896%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHere%20is%20attached!!%3C%2FP%3E%0A%3CP%3ERegards%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2190263%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Post%20Quantization%20Model%20Runs%20on%20iMX93%20NPU%2C%20but%20Output%20is%20Incorrect%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2190263%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EWould%20you%20mind%20sharing%20the%20script%20you%20used%20to%20successfully%20run%20it%3F%20Perhaps%20I%20have%20written%20my%20script%20incorrectly.%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2190262%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Post%20Quantization%20Model%20Runs%20on%20iMX93%20NPU%2C%20but%20Output%20is%20Incorrect%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2190262%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EYour%20model%20can%20run%20with%20the%20latest%20BSP%2C%20it%20uses%20GPU%20besides%20the%20performance%20it%20run%20very%20well%2C%20I%20can%20not%20see%20any%20error.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2190250%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Post%20Quantization%20Model%20Runs%20on%20iMX93%20NPU%2C%20but%20Output%20is%20Incorrect%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2190250%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EI%20have%20attached%20the%20model.%20The%20BSP%20is%20Linux%20BSP.%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2187650%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Post%20Quantization%20Model%20Runs%20on%20iMX93%20NPU%2C%20but%20Output%20is%20Incorrect%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2187650%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3EPlease%20provide%20the%20model%20and%20which%20BSP%20are%20you%20testing%3F%3C%2FP%3E%0A%3CP%3ERegards%3C%2FP%3E%3C%2FLINGO-BODY%3E