2024-04-09 06:01 AM
The error occurs in both Mac m1 and windows. When I use "stm32ai validate/generate" command, I find that "-O ram" outputs totally strange results.
Let's use fdmobilenet_0.25_224_tfs_int8.tflite from stm32ai-modelzoo as an example.
The "X-cross #1" here is 100% which is perfect, but for "stm32ai validate -O ram fdmobilenet_0.25_224_tfs_int8.tflite", something strange happens.
The "X-cross #1" is 10% and the accuracy of c-model is 0% meaning that the model can hardly do what the developers want to do.
Note that this happens in about 30% models for image classification in stm32ai-modelzoo as I tested.
To get a rough reason for this problem, I observer the intermediate output per layer between "-O ram" and "-O time/balanced". I find that, for only fdmobilenet_0.25_224_tfs_int8.tflite, the difference first happened in a "conv2D + maxpool" layer. In "-O ram", it is fused as one c-layer but split as two layers in "-O time/balanced".
I guess the problem may arise in the quantization and dequantization of the fusion operator since I find repeated "128" and "255" of "uint8" in the output of "-O ram".
Because this part of the code is black box, internal developers are needed to ultimately solve the problem. I would be more than happy to be a part of this process
Solved! Go to Solution.
2024-04-09 07:41 AM
Hello ManuZhu,
Thanks to share this experimentation. I suppose that you use X-CUBE-Ai 8.1. I have effectively reproduced your issue with the "-O ram" option and this model. This issue has been normaly fixed in the last release: X-CUBE-AI 9.0. Can you check on your side?
br,
Jean-Michel
2024-04-09 07:41 AM
Hello ManuZhu,
Thanks to share this experimentation. I suppose that you use X-CUBE-Ai 8.1. I have effectively reproduced your issue with the "-O ram" option and this model. This issue has been normaly fixed in the last release: X-CUBE-AI 9.0. Can you check on your side?
br,
Jean-Michel
2024-04-10 06:51 PM
Hello Jean-Michel,
Thanks to your reply. I have checked on my side and find that everything goes right.
I'm curious if you could share why this problem occurs in X-CUBE-Ai 8.1 :)