Search code examples
python-3.xkerasneural-networklstmrecurrent-neural-network

ModuleNotFoundError: No module named 'keras.layers.recurrent'


I am trying to import LSTM in python

from keras.layers.recurrent import LSTM

However, I get below error message on compilation:

ModuleNotFoundError: No module named 'keras.layers.recurrent'

Can somebody please help me out with this?


Solution

  • if you're using the tensorflow version 2.10.0, try this

    from keras.layers import LSTM
    

    you can check it at the link bellow https://www.tensorflow.org/api_docs/python/tf/keras/layers/LSTM