Skip to main content
KP_it
Associate II
June 19, 2020
Question

STM32F411RE CubeMX 5.6.1 generated simple AI project compiling OK, But gives error in MX_X_CUBE_AI_Process();

  • June 19, 2020
  • 1 reply
  • 1121 views

I have a simple binary classification ANN model built with Tensorflow Keras and converted as Tensorflowlite model. This model gets imported and analyzed on the cubeMX tool without any errors. There is no IO input required for this trial model, so allowing random numbers for input features. Without any modifications to the code imported to STM32CubeIDE and build succeeds. While debugging, i can see that inside MX_X_CUBE_AI_Process() --> aiRun() method is returning error code 23 and error Type as 18.

Since the analyze function succeeded during code generation process, i expected that this code runs without any modification. Any suggestions please?

    This topic has been closed for replies.

    1 reply

    KP_it
    KP_itAuthor
    Associate II
    June 20, 2020

    I am using a simple dataset from following site https://archive.ics.uci.edu/ml/datasets/banknote+authentication and using tensorflow python model program as attached.

    other information: X-CUBE-AI 5.1.1

    Nucleo board: STM32F411RE

    KP_it
    KP_itAuthor
    Associate II
    June 23, 2020

    All,

    Just posting the issue i found and workaround performed to get this done. There is some issue with TFlite converter program as of date. When tensorflow keras feature layer is included, it fails to properly function inside the STM32. I had to then revert to bare bone keras input layer building with numpy arrays and shapes defined. Once i included method, it imported well and also performs as expected in STM32.

    note: dont forget to convert result output bytes back to float to infer the output in right way.

    Attached is the revised python program.

    All the best.