2023-05-11 12:22 AM
Solved! Go to Solution.
2023-05-15 12:19 AM
Thanks for your data and models (and status). Effectively after analysis, I had detected an issue in cifar10_test_label.npy file where the one shot encoding representation was wrong (left-shift per one in the index). I dont't know if the "MCU_AI-masterCIFAR10etinynet_epoch272_params.oonx" model was correctly trained but with the provided data, I had a bad accuracy using directly the onnx file (outside X-CUBE-AI). Idem with "CIFAR10mobilenetSlim_quant_static.onnx" file.
However, I have noted that the model has been quantized with the option "per_channel=False", it is recommended to use "per_channel=True" to have a better precision.
br,
Jean-Michel
2023-05-11 12:36 AM
Hello,
To compute the accuracy with CUBEAI desktop, you provide your own data or you use the random data?
Exported ONNX model (from Pytorch) is quantized or not?
Regards,
Jean-Michel
2023-05-12 12:16 AM
Thank you very much for your answer. I used self-generated data, and the model didn't quantify it. Here is my model and the data
2023-05-12 12:50 AM
2023-05-12 06:32 AM
2023-05-13 02:12 AM
I have solved this problem. There are some errors in my data. Thank you very much
2023-05-15 12:19 AM
Thanks for your data and models (and status). Effectively after analysis, I had detected an issue in cifar10_test_label.npy file where the one shot encoding representation was wrong (left-shift per one in the index). I dont't know if the "MCU_AI-masterCIFAR10etinynet_epoch272_params.oonx" model was correctly trained but with the provided data, I had a bad accuracy using directly the onnx file (outside X-CUBE-AI). Idem with "CIFAR10mobilenetSlim_quant_static.onnx" file.
However, I have noted that the model has been quantized with the option "per_channel=False", it is recommended to use "per_channel=True" to have a better precision.
br,
Jean-Michel
2023-05-15 12:33 AM
Thank you very much for your answer, I found the problem. I did not perform the same transform as in the training process when generating npy data, nor did I perform the same data transform when generating calibration data in the static quantization process. So it's very low precision.
I would like to know how to modify the code if I want to add the camera to collect images for target detection in the future. The generated code seems a little difficult to read, is there any demo you can refer to? I use stm32f746G-discovery.