2025-05-30 5:00 AM - last edited on 2025-05-30 8:41 AM by Andrew Neil
Hi,
I have migrated to STEdgeAI v2.1 and I can't analyze or compile an audio ONNX quantizaied model for STM32N6.
Before this, the same model was being analized correctly with version 2.0 of stedgeai.
This is the error:
C:/ST/STEdgeAI/2.1/Utilities/windows/stedgeai.exe analyze -v3 --target STM32N6 -m "model.onnx"
ST Edge AI Core v2.1.0-20194 329b0e98d
INTERNAL ERROR: Unexpected condition
The PASS progress is rising to 11%, but then it fails and stops. There isn't any other log information.
Is there any bug with the STEdgeAI new version that explains this behaviour?
Thank you,
Gilen
2025-05-30 6:52 AM
Hello
If it used to work and does not work anymore, this is not expected.
Can you share your model please, so we can understand what is going on here , and give you some feedback ?
Thanks
2025-05-30 7:57 AM
2025-06-02 12:57 AM
Hello
Thanks a lot for your input.
It is taken into account, we will analyze & try to fix that asap.
Sorry for the inconvenience (if we can provide you with a workaround, i will keep you updated)
2025-06-02 1:41 AM
Hello,
Thanks for your support. I'll be waiting for your updates on this issue.
2025-06-04 8:11 AM
Hello,
I have been advancing with the integration of EfficientAT in STM32N6, but with stedgeai 2.0.
I am trying to change the Yamnet model of the stm32ai-modelzoo-services demos with EfficientAT.
I have fine tuned EfficientAT with ESC-50 dataset.
The deploy and compilation with stedgeai 2.0 are running right and a quantizied onnx model is created (with per channel or per tensor mode).
I attach the report, the onnx model generated and network coverted to C code.
There is not any error message and based in the application code GS_Audio_N6 for Yamnet, I have made the changes to support this model: 32kHz audio captured by microphone and mel spectrogram calculation with a particular pre-emphasis and normalization. The input shape of the model is int8 [1, 128, 250, 1]. The output is float [1, 50]. I have checked that the spectrogram generated in microcontroller is the same that needs the EfficientAT model. I attach the STM32N6 generated spectrogram image, and the generated in PC for a 440Hz tone.
I modified the RAM sector LENGHT in linker script to 2047K. And the _Min_Heap_Size = 0x40000.
This onnx model is doing precise predictions in PC with python and onnxruntime. For example, a wav with the tone of 440Hz captured with the STM32N6570-DK's micropone is passed through the model in PC and the inference output is this:
************* Acoustic Event Detected (ONNX): *****************
siren: 0.959
wind: 0.702
mouse_click: 0.524
washing_machine: 0.500
clock_tick: 0.488
can_opening: 0.476
door_wood_knock: 0.464
car_horn: 0.464
crackling_fire: 0.452
door_wood_creaks: 0.441
***************************************************************
But when the model is running in STM32N6, it doesn't predicts anything. The prediction output is allways the same: "washing_machine". And the 50 float numbers with percentage outputs (200 bytes) are always the same, they are not changing although the audio is different.
Could there be any error in the generated network code? Is there any operation that is not supported?
Could it be an issue with RAM memory?
Could there be any relation with this malfunctioning and the "INTERNAL ERROR: Unexpected condition" that is reporting the stedgeai 2.1 when analyze this model?
Thank you and regards,
Gilen