cancel
Showing results for 
Search instead for 
Did you mean: 

X-CUBE-AI doesn't detect the Layers of my keras model correct on STM32H7

wga
Visitor

Hi everyone,

I have created a NN with tensorflow:

# ----- Model Definition -----
def build_model(input_dim):
    model = Sequential([
        InputLayer(shape=(input_dim,)),
        Dropout(0.2),
        Dense(128, activation='relu'),  # increased layer size
        Dense(64, activation='relu'),
        Dense(32, activation='relu'),
        Dense(1, activation='linear')
    ])
    model.compile(optimizer='adam', loss='mse', metrics=['mae'])
    return model

model = build_model(X_train.shape[1])

When I import this into X-CUBE-AI in STMCubeMX and analyze it, there are no Errors. However when I press show Graph, you can see that it imported just a single layer, even though there should be 4.

wga_0-1752238223716.png
When i upload the same model in ST Edge AI Developer Cloud, it does the layers correct:

wga_1-1752238419143.png

I can even run the benchmark in the cloud on the same STM32H7 which I have physically on my desk and it works.

Because the layers are not detected correctly in my local STM32CubeMX, i get really bad performance when I validate the model. I also tried importing .h5 file, but it doesn't change. Is there some limitations in layers or do I need a special export of the model?

 

 

0 REPLIES 0