cancel
Showing results for 
Search instead for 
Did you mean: 

X-CUBE AI PROBLEM WITH INFERENCE RESULT

AAli.2
Associate II

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.

 

 

 

 

 

7 REPLIES 7
fauvarque.daniel
ST Employee

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.


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.

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. 

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


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.

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?

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


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.

Is there a tutorial I can follow for all you suggested?

https://www.st.com/en/embedded-software/x-cube-ai.html#documentation

The document details step by step how to use the UI


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.