笔者开发使用:Ubuntu16.04+GeForce1060 +tensorflow-gpu+Python3.5+eclipse3.8。
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 0
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 300
sudo apt-get install python3-pip
sudo pip3 install --upgrade pip
检查版本:
ubuntu-drivers devices
这里是nvidia-375,安装
sudo apt-get install nvidia-375
重启
官网下载:https://developer.nvidia.com/cuda-downloads
这里下载的是cuda_8.0.61_375.26_linux.run
安装:
sudo sh ~/Downloads/cuda_8.0.61_375.26_linux.run --override
具体操作:
CTRL+C跳过介绍
Do you accept the previously read EULA?
accept/decline/quit: accept
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 367.48?
(y)es/(n)o/(q)uit: n
Install the CUDA 8.0 Toolkit?
(y)es/(n)o/(q)uit: y
Enter Toolkit Location
[ default is /usr/local/cuda-8.0 ]:
Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: y
Install the CUDA 8.0 Samples?
(y)es/(n)o/(q)uit: y
Enter CUDA Samples Location [ default is /home/用户名 ]:
装完后显示:
===========
= Summary =
===========
等内容
官网下载:https://developer.nvidia.com/cudnn
这里用的是:cudnn-8.0-linux-x64-v5.1.tgz
安装:
cd /usr/local
sudo tar -xzvf ~/Downloads/cudnn-8.0-linux-x64-v5.1.tgz
gedit ~/.bashrc
添加:
export PATH=/usr/local/cuda-8.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:/usr/local/cuda-8.0/extras/CUPTI/lib64:$LD_LIBRARY_PATH
export CUDA_HOME=/usr/local/cuda-8.0
编译一下:
source ~/.bashrc
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.2.0rc0-cp35-cp35m-linux_x86_64.whl
sudo pip install --upgrade $TF_BINARY_URL
试一下:
python
>>>import tensorflow
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk
sudo apt-get install eclipse
配置pydev:
打开eclipse:
终端输入:eclipse
help-->install new software-->add-->name:Pydev;location:http://pydev.org/update_sites/4.5.5-->select all-->next-->......
配置解释器:
window-->preferences-->Pydev-->interpreters--->python interpreter-->new-→browse-->file system-->/usr/bin/python3.5-->OK-->......
×ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory
参考:http://blog.csdn.net/liuyifang0810680/article/details/53008698
×Check failed: s.ok() could not find cudnnCreate in cudnn DSO
参考:http://www.linuxdiyf.com/linux/16684.html
×升级tensorflow1.1版本后,ImportError: libcufft.so.8.0: cannot open shared object file: No such file or directory
终端输入:
sudo cp '/usr/local/cuda-8.0/lib64/libcufft.so.8.0' '/usr/lib'