环境是ubuntu18.04,独立显卡。
- 先参考以下网址的版本对应关系,
https://blog.csdn.net/wanzhen4330/article/details/81660277
我用的是这个搭配
python 2.7,GCC 4.8,Bazel 0.8.0,cuDNN 7,CUDA 9,tensorflow_gpu-1.5.0,加上keras 2.1.4 - 然后参考以下网址安装CUDA+cuDNN
https://blog.csdn.net/qq_32408773/article/details/84112166 - 然后装tensorflow,瞬间装完,去Python里面import tensorflow as tf验证,没有报错!!!事实证明不要用源代码安装。
pip install tensorflow-gpu==1.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
- 然后装keras,
pip install keras==2.1.4 -i https://pypi.tuna.tsinghua.edu.cn/simple
再去Python里面验证
~$ python
Python 2.7.15 |Anaconda, Inc.| (default, May 1 2018, 23:32:55)
[GCC 7.2.0] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
import tensorflow
import keras
Using TensorFlow backend.