一、安裝CUDA和cuDNN
1.CUDA和cuDNN的版本對應關系
去官網查看:https://developer.nvidia.com/rdp/cudnn-archive
2.TensorFlow與CUDA、cuDNN的版本對應關系
https://tensorflow.google.cn/install/source#linux
二、根據對應的版本安裝TensorFlow-gpu版本
# 創建虛擬環境:tmp_python conda create -n tmp_python python=2.7 # 顯示自己創建的虛擬環境 conda env list # 進入創建虛擬環境 source activate tmp_python #安裝指定 版本的TensorFlow pip install tensorflow-gpu==1.9.0 # 安裝的包 conda install cudatoolkit=9.0 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/ conda install cudnn=7.1.2 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/
參考文獻:
①https://www.jianshu.com/p/3d8a444ff440
②https://blog.csdn.net/qq_35614920/article/details/79116103?spm=1001.2101.3001.4242