cancel
Showing results for 
Search instead for 
Did you mean: 

E010 (InvalidModelError): Couldn't load Keras model

AI_I
Associate II

c84d46c9-9747-4f4c-b9c6-3c0103af8bf1.jpeg

I want to deploy a model I've trained on my STM processor using STM32 Cube AI, but I am encountering some issues. Could someone with experience in this area assist me? I don’t see any obvious issues in my model, but there could still be something wrong with it. Since I don’t have much experience in this area, any help would be greatly appreciated.
I am encountering an error when trying to perform the 'validate on desktop' operation. The error message is as follows:

E010(InvalidModelError): Couldn't load Keras model W:\BYS_Tez\LSTM\model_RNN.h5, Error when deserializing class 'InputLayer' using config={'batch_shape': [None, 10, 3], 'dtype': 'float32', 'sparse': False, 'name': 'input_layer_9'}. Exception encountered: Unrecognized keyword arguments: ['batch_shape']

I have attached the model. I would greatly appreciate any help with resolving this issue.

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @AI_I ,

At the moment quantized recurrent layers (LSTM GRU...) are not supported directly by ST Edge AI (XcubeAI).

However, it is possible to circumvent this limitation, by decomposing your recurrent layers into their constituent operations (e.g. for LSTM : Dense layers, Tanh, Sigmoïd, etc.) for a single timestep. See the attached .tflite file for a mockup of what this would look like.

Unfortunately, as of now, we cannot provide automated scripts to perform this decomposition on your own model.

 

We are continuously improving ST Edge AI to add more layers.

 

Have a good day,

Julian

 

 


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.

View solution in original post

3 REPLIES 3
Julian E.
ST Employee

Hello @AI_I ,

Can you attach the model as a .zip file please.

 

Have a good day,

Julian


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.

Hello, at this point, I resolved my errors. I fixed the issues in my LSTM and RNN models, but I encountered an output message indicating unsupported layer types: FlexTensorListStack, FlexTensorListReserve, and WHILE, which caused the process to stop. Due to time constraints, I completed my project using FCNN and FNN models instead. However, I’m still interested in learning how to effectively use LSTM and RNN models.

Hello @AI_I ,

At the moment quantized recurrent layers (LSTM GRU...) are not supported directly by ST Edge AI (XcubeAI).

However, it is possible to circumvent this limitation, by decomposing your recurrent layers into their constituent operations (e.g. for LSTM : Dense layers, Tanh, Sigmoïd, etc.) for a single timestep. See the attached .tflite file for a mockup of what this would look like.

Unfortunately, as of now, we cannot provide automated scripts to perform this decomposition on your own model.

 

We are continuously improving ST Edge AI to add more layers.

 

Have a good day,

Julian

 

 


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.