安裝工具
在Power Shell下執(zhí)行,“開(kāi)始”->“附件”->“Windows Power Shell”->“Windows Power Shell”
Python
-安裝Anaconda 4.2.0 For Windows
Anaconda 4.2.0 For Windows
-設(shè)置環(huán)境變量
將Python安裝路徑下“%安裝路徑%\Scripts”添加到Path下粪小;再到PowerShell中輸入pip看到若干命令提示髓梅,則代表python安裝成功(Python安裝包自帶pip)躏将$韫“開(kāi)始”->“所有程序”歇终,也可以找到Python終端。
安裝CUDA
CUDA安裝:CUDA下載
安裝CUDNN
CuDNN安裝:CUDNN下載
(要注冊(cè)Nvidia用戶(hù)警医,并加入CuDNN開(kāi)發(fā)組,填若干問(wèn)卷就可以下載了)
選擇下載版本時(shí)要注意和Cuda版本匹配坯钦。解壓后覆蓋至CUDA的安裝目錄下,例如:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\
修改國(guó)內(nèi)Pip源
為了使用國(guó)內(nèi)鏡像加速pip安裝预皇,需要如下修改:
WIndows 7 在“C:\Users\用戶(hù)名\AppData\Local\pip”文件夾下,新建文本文件婉刀,添加內(nèi)容:
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
關(guān)于修改pip國(guó)內(nèi)源可參考這里
安裝TensorFlow
Power Shell下輸入:
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl
測(cè)試TensorFlow
>>>import tensorflow as tf
>>>sess = tf.Session()
>>>a = tf.constant(10)
>>>b = tf.constant(22)
>>>print(sess.run(a + b))
32
正確輸出結(jié)果32深啤,安裝完畢。