要查看tensorflow 与cuda版本的对应关系
查看cuda版本
cat /usr/local/cuda/version.txt
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
nvcc -V
下载cuda,cudnn
cudnn
需要登陆下载 library 版本
cuda网址,下载runfil(local)版本
安装
cuda
sudo chmod +x cuda_9.0.176_384.81_linux.run # 为 cuda_9.0.176_384.81_linux.run 添加可执行权限
./cuda_9.0.176_384.81_linux.run # 安装 cuda_9.0.176_384.81_linux.run
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81?
(y)es/(n)o/(q)uit: n # 如果已经安装过了,则不需要安装显卡驱动
cudnn
|
|
sudo vim ~/.bashrc
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} export CUDA_HOME=/usr/local/cuda
source ~/.bashrc 使之生效
安装tensorflow
conda create -n name python=3.6
pip install tensorflow-gpu==1.11 -i https://pypi.tuna.tsinghua.edu.cn/simple
参考:https://blog.csdn.net/uhauha2929/article/details/83448909
https://www.cnblogs.com/jins-note/p/9598178.html
tensorflow指定版本的安装及升级到最新版:https://blog.csdn.net/leitouguan8655/article/details/82897525