Home > Net >  ImportError: cannot import name 'tf2' for LSTM from Keras
ImportError: cannot import name 'tf2' for LSTM from Keras

Time:02-11

I want to use the LSTM, however when I want to import that, I got the following error. Could you please help me with that? thanks

from tensorflow import keras
print('keras version:', keras.__version__)
print('tensoflor version:', tf. __version__)
from keras.layers import LSTM, Dense

Here is the error

CodePudding user response:

It seems that your tensorflow is too old and your keras is new. Downgrade the keras or upgrade the tensorflow.

  • Related