想安装,直接看后面的 TF 安装
- 需要装的软件
- CUDA驱动,cuDNN,TF
CUDA驱动,cuDNN,TF 关系介绍
https://blog.youkuaiyun.com/xs11222211/article/details/84782046
除TF外都按当期那最新版本
-
Ubuntu版本决定最高显卡驱动版本
查看当前系统推荐的显卡驱动版本ubuntu-drivers devices
-
驱动版本决定最高cuda和cudnn版本
显卡版本对应的cuda和cudnn版本
https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html -
cuda版本决定TF最高版本
https://www.tensorflow.org/install/source#install_gpu_support_optional_linux_only
TF安装
- 建议 用 docker 安装
- 在 tensorflow 的 docker hub找直接版本的镜像运行
- 也可以使用镜像提供的cuda等环境,直接在conda里用虚拟环境搭TF
conda create --name tensorflow_gpu python=3.6
source activate tensorflow_gpu
conda install tensorflow-gpu==1.11.0
检验TF 安装情况
python -c "import tensorflow as tf; print(tf.test.gpu_device_name())"
or
import tensorflow as tf
tf.test.is_gpu_available()