tanakamasayuki / Arduino_TensorFlowLite_ESP32

Allows you to run machine learning models locally on your ESP32 device.
Apache License 2.0
218 stars 48 forks source link

Support for LSTM and Autoencoder #10

Open expeon07 opened 2 years ago

expeon07 commented 2 years ago

Hi, I'm trying to implement a multivariate time series prediction model using LSTM, and an anomaly detection model using autoencoders. I have successfully converted them to a TFLite version and tried to upload them in my ESP32.

However I get the following error: Only 1 subgraph is currently supported.

Are LSTMs and anomaly detection supported by this library? If so, are there special configurations that I need to do?

Thanks!

tanakamasayuki commented 2 years ago

I'm sorry. Since it is an old version, some functions cannot be used. It is recommended to use the latest version with ES-IDF.

https://www.tensorflow.org/lite/microcontrollers

I'm planning to upgrade, but I don't have time.

koulnodji6056 commented 1 year ago

@expeon07 could you please share with me the code for converting the LSTM model to TFLite? I have not succeeded in the conversion. Thank you

expeon07 commented 1 year ago

@expeon07 could you please share with me the code for converting the LSTM model to TFLite? I have not succeeded in the conversion. Thank you

Hi, I unrolled the LSTM layer by turning unroll=True (default to false)

koulnodji6056 commented 1 year ago

@expeon07 please I am not getting it clear. Is that turning of unroll=True (default to false) was done during model training of during model conversion (TFliteConverter)? kindly, I request more explanation or a close orientation. NB: I don't have much experience in coding

expeon07 commented 1 year ago

@expeon07 please I am not getting it clear. Is that turning of unroll=True (default to false) was done during model training of during model conversion (TFliteConverter)? kindly, I request more explanation or a close orientation. NB: I don't have much experience in coding

Hi, I think it's during the model training. I cannot remember as I only tried it months ago. Have you tried doing either/both yourself? You can ask the developers in the TFlite repo as well

koulnodji6056 commented 1 year ago

@expeon07 Noted with thanks