1 Keras is based on tensorflow, so you need to install TensorFlow first to install keras (1.x version, 2.0 is not required)
2 In view of the fact that I have installed tf, so
I start directly from keras. Let me first install the version configuration before installation:
first in activate tf environment at anaconda prompt
pip install keras -i https://pypi.tuna.tsinghua.edu.cn/simple
The display is successful, but enter python import keras and report a version error
. The tf version does not match the keras version.
Version corresponding reference:
https://docs.floydhub.com/guides/environments/My
tf is 1.2.1, so I need to replace keras == 2.0.6
Reference: https://blog.csdn.net/qq_27921205/article / details / 102976824
pip install keras==2.0.6 -i https://pypi.tuna.tsinghua.edu.cn/simple
Then import again reported the numpy version error.
Need to update numpy
pip install --upgrade numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
Then found that the numpy version is wrong, okay, check the current numpy version
import numpy as np
np.__version__
Need to be replaced with 1.16.0
https://blog.csdn.net/bigdream123/article/details/99467316
pip install --upgrade numpy==1.16.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
Ok no error