2024-07-17 06:38 AM - edited 2024-07-17 06:41 AM
I have created my own cnn model and want to run it on STMH753ZI board using X-CUBE-AI. I have executed all the steps to run the inference. The inference is also running but the output is always 0. With my fixed input of sample shape (1,50,12). I cannot understand the problem. I attaching the code script and the terminal output.
2024-07-17 08:35 AM
You can use the validate command on host or on the target to verify that your model is behaving the same way in Python and in C.
Generally it could be a problem with the way you pass the data to the network especially when the network is quantized.
2024-07-18 02:15 AM
I have validated on desktop and on target. It validates successfully on system but give an error when validating on target.
Running the Keras model...
Running the STM AI c-model (AI RUNNER)...(name=cnn, mode=TARGET)
INTERNAL ERROR: E801(HwIOError): Invalid firmware - COM9:115200
Whereas COM9 is the port that I use to run the inference on board with output on Putty terminal which it does.
I am attaching the screenshot of validation as well. I try to give the input in the same way as well as I see in validation like a 3d array to get shape (1,50,12). But doesn't seem to work.
2024-07-18 04:57 AM
One way to see if the validation program is starting correctly on the board is to launch a pseudo tty on this com port and see if you have messages coming from the validation program when you reset the board (reset button).
If you have no messages the compile / flash of the program did not happen or did not finish successfully
2024-07-23 03:28 AM
I believe there is an issue with the flashing during Validation on Target. Because when I do as you suggested. I get messages on PUTTY of the old firmware I flashed for inference. INTERNAL ERROR: E801(HwIOError): Invalid firmware - COM9:115200 How to resolve this error?
2024-07-23 04:39 AM
Generate the code separately (AI + Validation application), compile it and flash it using your IDE or STM32CubeProgrammer.
You can also see in the log (under ~/.stm32cubemx/STM32CubeMX.log) the output of the different commands and you'll see if the automatic call to STM32CubeProgrammer was successful
Regards
2024-07-23 04:43 AM
Is there a tutorial I can follow for all you suggested?
2024-07-23 07:46 AM
https://www.st.com/en/embedded-software/x-cube-ai.html#documentation
The document details step by step how to use the UI