Windows環境下的TensorFlow安裝過程

來源:互聯網
上載者:User

標籤:註冊   evel   檔案   amd   lan   本地   src   ade   pre   

安裝環境
  • Windows8.1
  • python3.5.x(TensorFlow only supports version 3.5.x of Python on Windows)
  • pip 9.0.1
  • tensorflow-gpu-0.12.0
  • cuda

cudnn

安裝過程
  • 安裝Python3.5
  • 安裝python     
     :https://www.python.org/
  1. 點擊Downloads下的Windows,本次選用了Python 3.5.2版本

    

      選擇其中的第五個,Windows x86-64 executable installer下載安裝(安裝的時候最好把添加環境變數那個打鉤,這樣就不需要自己配置環境變數,後續的需要的地方都打鉤,一路next)

     2. 升級pip

        開啟cmd輸入

python.exe -m pip install --upgrade pip
  • 安裝TensorFlow

     (本次採用的線上安裝,也可以下載到本地,進行本地安裝)

     安裝gpu版本

pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-0.12.0-cp35-cp35m-win_amd64.whl

 

     安裝CPU版本

pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0-cp35-cp35m-win_amd64.whl

   

     查看你的gpu是否支援cuda

     gpu版本要安裝gpu支援包(cuda8.0地址和cudnn5.1地址)

     安裝cuda8.0

    

    安裝對應的cudnn(這個貌似需要登入Nvdia帳號才能夠下載,我是先註冊的)

    找到你需要的版本,下載cudnn壓縮檔後進行解壓,添加解壓後的bin目錄到PATH環境變數。

  • 測試TensorFlow
$ python...>>> import tensorflow as tf>>> hello = tf.constant(‘Hello, TensorFlow!‘)>>> sess = tf.Session()>>> print(sess.run(hello))Hello, TensorFlow!>>> a = tf.constant(10)>>> b = tf.constant(32)>>> print(sess.run(a + b))42

 

Windows環境下的TensorFlow安裝過程

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.