cancel
Showing results for 
Search instead for 
Did you mean: 

X-CUBE-AI, tflite LSTM model: Unsupported layer types

CFrancesco
Associate

Hi,

I’m currently trying to upload the following LSTM model into a STM32L476RG via X-CUBE-AI

CFrancesco_0-1690184731832.png

Uploading the Keras .h5 model works well, however when I try to upload the TensorFlow Lite converted version of the same model, I get the following prompt:

CFrancesco_1-1690184772998.png

Any ideas about how to solve this problem?

 

Some information about my setup:

STM32CubeMx version: 6.8.0

X-CUBE-AI version: 8.1.0

TensorFlow version: 2.10.0

 

Thank you very much.

3 REPLIES 3
saralf
Associate

Hi,

I have the same issue with a similar LSTM model. Did you  solve it?

fauvarque.daniel
ST Employee

The conversion to TFLite unfolds the LSTM layer in many different ways depending on the paramters of the LSTM and if it is stateless or stateful.

UNIDIRECTIONAL_SEQUENCE_LSTM is supported by X-Cube-AI, you can follow the instructions here https://www.tensorflow.org/lite/models/convert/rnn to properly convert your Keras LSTM model into a tflite model understood by X-CUBE-AI

Regards


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.
nuvyas
Associate

Hello,

I tried the above mentioned solution but still got the same error....

I am also implementing a CRNN model which consists of CNN layers and LSTM layers inside it, but LSTM part is not being implemented. 

I am doing audio processing over the board and using LSTM can prove to be very efficient for them. 

I have X-Cube-AI 9.0.0, is there any other version I should use? Is there any other way I can work around with LSTM deployment on the board. 

My model description: 

nuvyas_0-1713517426345.png

Here, 128 corresponds to the height of the input spectrogram (frequency bins), 600 corresponds to the width (time steps or frames), and 1 corresponds to the number of channels (mono audio).

 

Any help is appreciated really,

Thanking you

N.U.Vyas