一郭卫、安裝環(huán)境
1.1 操作系統(tǒng):Windows 10 64位
1.2 顯卡:NVIDIA 965M(Compute Capability 5.2)CUDA查詢鏈接
1.3 NVIDIA Driver 416.34
1.4 CUDA Toolkit 9.0 Base Installer & Patch1-4
1.5 cuDNN v7.3.1
1.6 TensorFlow-GPU 1.11
二、安裝過程
2.1 安裝CUDA
2.1.1 安裝CUDA Toolkit 9.0 Base Installer
2.1.2 安裝CUDA Patch1-4
其中峡钓,安裝Patch1時(shí)程序閃退葛超,解決方案:刪除C:\Program Files\NVIDIA Corporation\Installer2
文件夾后重新安裝怖辆。
2.1.3 設(shè)置環(huán)境變量
CUDA_SDK_PATH = C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.0
CUDA_LIB_PATH = %CUDA_PATH%\lib\x64
CUDA_BIN_PATH = %CUDA_PATH%\bin
CUDA_SDK_BIN_PATH = %CUDA_SDK_PATH%\bin\win64
CUDA_SDK_LIB_PATH = %CUDA_SDK_PATH%\common\lib\x64
2.1.4 測試環(huán)境變量
set cuda
2.2 安裝cuDNN v7.3.1 過程參照官方文檔
安裝完后測試CUDA宾尚。
進(jìn)入 C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\extras\demo_suite
目錄下執(zhí)行 deviceQuery.exe
執(zhí)行
bandwidthTest.exe
返回值為 PASS 說明安裝成功
2.3 安裝TensorFlow
2.3.1 創(chuàng)建虛擬環(huán)境
conda create -n TensorFlow-GPU python=3.6
2.3.2 進(jìn)入虛擬環(huán)境
activate TensorFlow-GPU
2.3.3 安裝GPU版TensorFlow
pip install --ignore-installed --upgrade tensorflow-gpu
2.3.4 測試TensorFlow
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
參考鏈接:
https://blog.csdn.net/dou3516/article/details/77836459
https://devtalk.nvidia.com/default/topic/1039261/cuda-9-0-patch-1-installation-problem/
https://blog.csdn.net/u013165921/article/details/77891913