cancel
Showing results for 
Search instead for 
Did you mean: 

I had some problems when i want to deploy a flower classification model from STM32 ai model zoo

123456dad
Associate II

123456dad_0-1697860087558.png

This is the model i use(through X cube ai 8.1.0)

By annalyze it ,the output should be float as below

123456dad_1-1697860219346.png

But the auto generated code declare it as ai_i8,why?

123456dad_2-1697860308592.png

and I can`t get result in the following way,I don`t konw the reason

123456dad_3-1697860519431.png

123456dad_0-1697861474939.png

 

Because of the limits ,I can only provide three files here.

I`d appreciate it if someone could answer my questions!!!

1 ACCEPTED SOLUTION

Accepted Solutions
STea
ST Employee

Hello @123456dad ,

this is due to the quantization of the model as explained in the UM2526 section 1.3:

  1. The code generator quantizes weights and bias, and associated activations from floating point to 8-bit precision.
    These are mapped on the optimized and specialized C implementation for the supported kernels.
    Otherwise, the floating-point version of the operator is used and float-to-8-bit and 8-bit-to-float convert operators
    are automatically inserted.
  2. The objective of this technique is to reduce the model size while also improving the CPU and hardware accelerator latency (including power consumption aspects) with little degradation in model accuracy.

so to improve CPU and hardware accelerator latency this conversion from float to the ai_i8 is needed.

Hope this answers your request .

BR

 

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
STea
ST Employee

Hello @123456dad ,

this is due to the quantization of the model as explained in the UM2526 section 1.3:

  1. The code generator quantizes weights and bias, and associated activations from floating point to 8-bit precision.
    These are mapped on the optimized and specialized C implementation for the supported kernels.
    Otherwise, the floating-point version of the operator is used and float-to-8-bit and 8-bit-to-float convert operators
    are automatically inserted.
  2. The objective of this technique is to reduce the model size while also improving the CPU and hardware accelerator latency (including power consumption aspects) with little degradation in model accuracy.

so to improve CPU and hardware accelerator latency this conversion from float to the ai_i8 is needed.

Hope this answers your request .

BR

 

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.