win7下安裝TensorFlow框架的gpu版本

首先附上成功截圖

歡迎大家評論,若碰到了問題,可以直接評論,看到了會立刻回覆
在這裏插入圖片描述

一、系統情況

系統:windows7
gpu:quadro p620
工具:cuda9.0+cudnn9.0+vs2015+Anaconda3.5.0.1

二、安裝工具準備

顯卡驅動+cuda9.0+cudnn9.0+vs2015+Anaconda3.5.0.1
cuda安裝教程見該鏈接(若已安裝請跳過該步驟):https://blog.csdn.net/u011609063/article/details/84887674
Anaconda3安裝:https://blog.csdn.net/u011609063/article/details/84888121

三、TensorFlow-GPU安裝

注意:TensorFlow不支持python3.7,最高只能支持到3.6,這裏我創建了python3.5的環境

  1. 配置清華鏡像(建議執行,否則下載太慢導致安裝失敗):
    conda config --add channels ttps://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  2. 顯示下載url(可選執行):
    conda config --set show_channel_urls yes
  3. 創建一個名爲python35,python版本爲3.5.x的運行環境(建議執行,創建一個單獨的環境運行TensorFlow):
    conda create -n python35 python=3.5在這裏插入圖片描述
    輸入y即可
  4. 激活運行環境(正確激活後)
    activate python35
  5. 輸入python會顯示如下結果(python的版本號可能不同)
    在這裏插入圖片描述
  6. 在當前環境中輸入以下命令即可安裝(此過程時間會比較長)
    conda install tensorflow-gpu
  7. 結果驗證:
在命令行中輸入python
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))	
最後會輸出Hello, TensorFlow!

四、Keras安裝

conda install keras

參考1:https://blog.csdn.net/weixin_39290638/article/details/80045236
參考2:https://www.leiphone.com/news/201711/GCh0IBszXrxP1iHU.html
參考3:Keras官方搭建網站https://keras-cn.readthedocs.io/en/latest/for_beginners/keras_windows/#_3
其餘參考已經展示在鏈接中,寫文章不易,轉載請註明原出處

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章