这次介绍的是使用 tensorflow1.8, cuda9.0, cudnn7.0的版本

sudo dpkg -i cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64.deb
sudo apt-key add /var/cuda-9-0-local/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda
tar -xzvf cudnn-9.0-linux-x64-v7.tgz
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
  • 配置环境变量,在~/.bashrc当中加入下面两句
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64$LD_LIBRARY_PATH
  • 安装tensorfloww-gpu,还有nvidia库完事
sudo apt-get install nvidia-cuda-toolkit
pip install tensorflow-gpu

版权声明:本文为Basasuya原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/Basasuya/p/9261107.html