Using Tensorflow 1.13 and Keras 2.2.4 with Anaconda
Does this not work for you?
conda create -n keras-gpu pip python=3.6
conda activate keras-gpu
pip install tensorflow-gpu==1.13.1
pip install keras==2.2.4
machinery
Updated on June 04, 2022Comments
-
machinery almost 2 years
I'm using Python with Anaconda. I have installed Tensorflow and Keras by creating a virtual environment:
conda create -n keras-gpu python=3.6 numpy scipy keras-gpu
I have used Python 3.6 because 3.7 is officially not yet supported by Keras. This installs Tensorflow 2.0.0 which is a problem because I have to change all imports from
from keras.models import Sequential
tofrom tensorflow.keras.models import Sequential
. Moreover, while this approach works, pyCharm shows me thatSequential
andmodels
are unresolved reference and thatkeras
cannot be found. By the way, how can I fix this? I included python.exe in the virtual environment as the interpreter.That's why I would like to use Tensorflow 1.13.1 and Keras 2.2.4. How can I create a virtual environment using this versions?
keras-gpu
just installs the newest versions.Or else is there a possibility to continue using
from keras.models import Sequential
with Tensorflow 2?-
Dr. Snoopy over 4 yearsI use Keras in python 3.7 every day, it is not true that it does not support it.
-
machinery over 4 years@MatiasValdenegro Alright, I will try Python 3.7. Do you have a solution for the problem that PyCharm does not recognize tensorflow.keras etc. (although it works when running the script)?
-
machinery over 4 years@MatiasValdenegro Is it possible to use import keras.models instead of import tensorflow.keras.models in TensorFlow 2? Otherwise I would have to change a lot in my code.
-