一、判斷顯卡類型
1.1判斷是否是NVIDIA的顯卡。如果是,可以安裝tensorflow-gpu版本。否則,只能安裝tensorflow-cpu版本(版本選擇最終在下載路徑上體現(xiàn))
參考文章:https://blog.csdn.net/Candy_GL/article/details/79435151
1.2安裝tensorflow-gpu版本要先更新顯卡驅(qū)動(dòng),安裝Cuda Toolkit和cuDNN。Cuda Toolkit和cuDNN的版本要根據(jù)顯卡版本選擇。
參考文章:
版本兼容:https://www.cnblogs.com/liaohuiqiang/archive/2018/10/15/9791365.html
驅(qū)動(dòng)安裝:http://www.itdecent.cn/p/4c0c66a07c1f
驅(qū)動(dòng)安裝:https://blog.csdn.net/u010618587/article/details/82940528
二、安裝Python
2.1目前TensorFlow僅支持到Python3.5。建議使用Anaconda做Python的版本兼容,以及下載TensorFlow
參考文章:http://www.itdecent.cn/p/6a1d9522b7c6
三、下載TensorFlow
3.1建議使用國內(nèi)鏡像服務(wù)站下載TensorFlow
參考文章:清華鏡像站:
tensorflow-cpu版本:https://mirrors.tuna.tsinghua.edu.cn/tensorflow/windows/cpu/
tensorflow-gpu版本:https://mirrors.tuna.tsinghua.edu.cn/tensorflow/windows/gpu/
參考命令如下:

注意:
1.在Anaconda環(huán)境中執(zhí)行下載命令;
2.建議從低版本開始安裝,比如從tensorflow-1.0.0開始安裝,然后慢慢更新到高版本。
四、測試tensorflow環(huán)境
python
import tensorflow
hello = tensorflow.constant("Hello,TensorFlow!")
sess = tensorflow.Session()
print(sess.run(hello))
b'Hello,TensorFlow!'
a = tensorflow.constant(10)
b = tensorflow.constantt(22)
print(sess.run(a + b))
32
五、將Anaconda的環(huán)境與PyCharm關(guān)聯(lián)
