2

When try to import the LSTM layer I encounter the following error:

from keras.layers.recurrent import LSTM

No module named 'LSTM'

So, I tried to download this module from website and another problem is the file type is .tar I don't know how to install it.

Tome
  • 3,234
  • 3
  • 33
  • 36
Tanakorn Taweepoka
  • 197
  • 2
  • 3
  • 14

3 Answers3

3

Use this one: from tensorflow.keras.layers import LSTM

pari
  • 788
  • 8
  • 12
0

try from tensorflow.python.keras._impl.keras.layers.recurrent import LSTM

0

this seems to work in my project (with tensorflow 2):

from tensorflow.python.keras.layers.recurrent import LSTM
Mike75
  • 504
  • 3
  • 18