2024-11-01 09:07 AM - last edited on 2024-11-07 05:43 AM by Andrew Neil
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.
Solved! Go to Solution.
2024-11-07 05:40 AM
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
2024-11-05 06:42 AM
Hello @AI_I ,
Can you attach the model as a .zip file please.
Have a good day,
Julian
2024-11-05 02:33 PM
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.
2024-11-07 05:40 AM
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