Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

ImportError: cannot import name 'tf2' for LSTM from Keras

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading