2025-07-11 6:04 AM
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.
When i upload the same model in ST Edge AI Developer Cloud, it does the layers correct:
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?