處理器:I5-7500
顯卡 :GTX1050Ti
系統 :Win10
1. 首先搭建Python環境。
官網https://www.python.org/downloads/下載Python3.7(目前最新的版本為3.7.4,暫時不用最新版本)。下載安裝完成後在環境變量中添加bin路徑。
cmd 運行 python 查看是否配置成功。
<code>C:\\Users\\admin>pythonPython 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>>/<code>
2. 下載Cuda
官網鏈接:https://developer.nvidia.com/cuda-downloads
網盤鏈接:https://pan.baidu.com/s/1K_PEdQ-aJRu3mnCpVvPREQ
提取碼:l2vw
按步驟安裝。
3. Cuddn
鏈接:https://pan.baidu.com/s/1BXCwyUb6fUF7ULfKJd_8VA
提取碼:qlgy
將解壓出來的文件替換到CUDA\\v10.0\\bin目錄下。
cmd 運行 nvcc -V 查看是否安裝成功。
<code>C:\\Users\\admin>nvcc -Vnvcc: NVIDIA (R) Cuda compiler driverCopyright (c) 2005-2018 NVIDIA CorporationBuilt on Sat_Aug_25_21:08:04_Central_Daylight_Time_2018Cuda compilation tools, release 10.0, V10.0.130/<code>
<code>C:\\Users\\admin>nvcc -Vnvcc: NVIDIA (R) Cuda compiler driverCopyright (c) 2005-2018 NVIDIA CorporationBuilt on Sat_Aug_25_21:08:04_Central_Daylight_Time_2018Cuda compilation tools, release 10.0, V10.0.130/<code>
4.tensorflow安裝
1> 通過pip install --upgrade tensorflow-gpu 安裝,驗證是否成功。
<code>import tensorflow as tfhello = tf.constant('Hello, TensorFlow!')sess = tf.Session()print(sess.run(hello))/<code>
2>打開pycharm,在菜單欄裡Flie-Settings-Project-Project interpreter,選擇Python3 interpreter,然後點擊+按鈕,輸入tensorflow-gpu,install package。
閱讀更多 飛橘科技 的文章