cancel
Showing results for 
Search instead for 
Did you mean: 

Cube AI and model Keras

IFaye.1
Associate II

Hello,

I get an issue when I try to load a Keras model in CubeMX (see image).

When I click on Validate on Desktop, all results are 0: acc, rmse and mae. Is it a bug on CubeMx?

I have the same result even if I compress my model. And I try another model with same result.

NB: models work well on python script.

When I generate code to execute model on Stm32H7 the output (predictions houses prices) of my NN is not correct (always 0 ).

Knowing that it's not mandatory to "Validate desktop" my model before deploy it. Is there a connection between both issues?

Regards,

3 REPLIES 3

Hello IFaye.1,

I can't reproduce the issue, could you please attach your .ioc file.

BR,

Khouloud.

IFaye.1
Associate II

Hello Othman,

thanks for your reply. Here, the ioc file. And you can find the base project here: https://github.com/ROC5COR/HousePricePredictionOnSTM32 (the model keras inside and the ioc that you can modify to appropraite board)

thanks!

Hello IFaye.1,

I don't think that this problem is related to STM32CubeMX tool, the results you got depend on Keras model you have used. the screenshot you have attached indicates an  L2 relative error of the output layer that exceeds 0.01 indicating a non-valid generated C model.  Note that it is still possible to consider the generated optimized C-model even if the tool reports a failed validation. The performance may not be aligned with the original Python model but the C-model can still be used. Further inspection is required, using, for example, a custom data set and NN output tracing.

So I think such metrics values are coherent with the incorrect output of your NN.

For further details you can refer to the X-CUBE-AI User Manual : https://www.st.com/resource/en/user_manual/dm00570145-getting-started-with-xcubeai-expansion-package-for-artificial-intelligence-ai-stmicroelectronics.pdf.

BR,

Khouloud.