2017年4月27日 星期四

Tensorflow 集合


Tensorflow 是運用 data flow graphs 觀念進行數值計算的開源程式庫,經常被應用在機器學習和深度神經網路研究等機器智慧研究領域上。

2017年4月26日 星期三

Windows 10 + NVIDIA GPU + TensorFlow


  1. 參考 Install TensorFlow with GPU for Windows 10
  2. 強烈建議:
    • 確實檢查自己的NVIDIA顯示卡是否支援?官網
    • Windows設定 %CUDA_HOME% 和添加CUDA相關目錄至%PATH%環境變數
    • Anaconda 同時安裝 Python2 和 Python3 兩版本:下載連結
    • 建立 Conda tensorflow-gpu 虛擬環境時,記得 Python3版本為 3.5
      • conda create -n tensorflow-gpu python=3.5 (暫時別選3.6)
    • activate tensorflow-gpu 後,安裝 numbapro 套件
    • 開啟 jupyter notebook 後,執行下列 python3 code:參考網站
    • from numbapro import cuda, vectorize, guvectorize, check_cuda
      from numbapro import void, uint8 , uint32, uint64, int32, int64, float32, float64, f8
      import numpy as np
      check_cuda()
      
    • 確認執行結果是否類似下列結果,最後出現的是 True !:
    • ------------------------------libraries detection-------------------------------
      Finding cublas
       located at d:\Anaconda3\envs\tensorflow-gpu\DLLs\cublas64_70.dll
       trying to open library... ok
      Finding cusparse
       located at d:\Anaconda3\envs\tensorflow-gpu\DLLs\cusparse64_70.dll
       trying to open library... ok
      Finding cufft
       located at d:\Anaconda3\envs\tensorflow-gpu\DLLs\cufft64_70.dll
       trying to open library... ok
      Finding curand
       located at d:\Anaconda3\envs\tensorflow-gpu\DLLs\curand64_70.dll
       trying to open library... ok
      Finding nvvm
       located at d:\Anaconda3\envs\tensorflow-gpu\DLLs\nvvm64_30_0.dll
       trying to open library... ok
       finding libdevice for compute_20... ok
       finding libdevice for compute_30... ok
       finding libdevice for compute_35... ok
      -------------------------------hardware detection-------------------------------
      Found 2 CUDA devices
      id 0    b'GeForce GTX 1060 6GB'                              [SUPPORTED]
                            compute capability: 6.1
                                 pci device id: 0
                                    pci bus id: 2
      id 1      b'GeForce GTX 650'                              [SUPPORTED]
                            compute capability: 3.0
                                 pci device id: 0
                                    pci bus id: 1
      Summary:
       2/2 devices are supported
      PASSED
      Out[1]:
      True
      
  3. 兩張顯示卡的GPU數量不同,另外在Windows環境設定TF_MIN_GPU_MULTIPROCESSOR_COUNT=2 錯誤訊息才消失
希望大家能少走點冤枉路...:P #