[問題] 跑tensorflow-gpu程式最低的GPU型號
各位大大 好
我的NB的GPU是GT 740m
GT 740m查google關鍵字compute capability只有3.0
算力3.0對應只能裝到cuda8
cuda v8再去查google只能裝到cudnn v5或v6或v7
https://gist.github.com/chizhang529/3c414428cd1c82e38e7dde0be70e2955
如上網址,tensorflow-gpu版本能安裝1.0.0至1.4.0
理論上,安裝anaconda,再anaconda prompt執行下面兩指令,anaconda安裝tensorflow-gpu
pip install tensorflow
pip install tensorflow-gpu
python程式中前面加入import tensorflow as tf
tensorflow程式就可以用GPU加速了
請教各位大大幾個問題
1.tensorflow-gpu程式用GPU去加速執行,用nvidia最低GPU型號可GPU執行python是多少?
另有一台筆電GT 940m
確定740m,940m都無法用GPU跑程式,會再考慮買二手NB的較新GPU版本
2.anaconda只用來跑numpy,matplotlib,scikit-learn等初階程式
非tensorflow-gpu,pytorch-gpu
一般python程式有機會GPU加速計算嗎?
3.GT 740m,已anaconda prompt安裝好
conda install cudatoolkit=8
conda install cudnn=6 |PackageNotFound
conda install cudnn=7 |有安裝cudnn=7.1.4,但程式無法載入原生tf執行階段
|推測740m顯卡需要cudnn=6
conda install tensorflow=1.4.0 |回應錯誤說找不到1.4.0,最低只有1.13.1
感覺repo目前已經沒有舊版本的cudnn與tensorflow-gpu套件可供下載了
推薦什麼anaconda repo呢? |自己回答,tensorflow官網說對anaconda沒全支援
謝謝大大
------------------------------------------------------------------------
謝謝下面各大大寶貴回應,已找到答案,整理如下
1.Windows 10 + GT 740m(compute capacability=3.0) +
NVIDIA圖形驅動程式376.54 + python v3.6
2.anaconda prompt
conda create -n tf_gpu python=3.6 anaconda
conda activate tf_gpu
conda install cudatoolkit=8
conda install cudnn=7
conda install tensorflow-gpu=1.4 |失敗,回版本過舊找沒有;
|查中國清大網站repo有gpu=1.4的.whl可下載安裝
|安裝了較高版本tensorflow-gpu=1.13.1
pip3 install tensorflow==1.4 |安裝成功,pip3可改pip
pip3 install tensorflow-gpu==1.4 |安裝成功,pip3可改pip
3.打開spyder,開新檔案,先另存新檔至C:\USERS\自己帳號\.spyder-py3
import tensorflow as tf
print("Tensorflow版本:",tf.__version_)
from tensorflow.python.client import device_lib
print(device_lib.list_all_devices())
執行結果:
Tensorflow版本:1.4.0
...
device_type: "CPU"
...
沒有顯示device_type: "GPU"
=> (1)確定GT 740m 僅算力3.0
GPU算力3.5以上,才能使用tensorflow-gpu算力
後來查到tensorflow-gpu=1.4.0,需算力3.5以上
tensorflow-gpu=1.3.0,需算力3.0以上
之後再試看看tensorflow-gpu=1.3.0,是否能顯示device_type: "GPU"
後驗證tensorflow-gpu=1.3.0,因下載不到cudnn=6,未能載入原生tf執行階段
(2)GT 940m 算力=5.0,能使用tensorflow-gpu加速
conda create -n tf_gpu python=3.6 anaconda
conda activate tf_gpu
conda install cudatoolkit=9
conda install cudnn=7 |安裝了cudnn7.3.1
pip3 install tensorflow==1.12.0 |安裝成功,pip3可改pip
pip3 install tensorflow-gpu==1.12.0 |安裝成功,pip3可改pip
執行結果:
Tensorflow版本:1.4.0
...
device_type: "GPU"
...
(3)另安裝OS上安裝官網下載cuda9,OS顯卡驅動經Windows Update自動升版
--
※
發信站: 批踢踢實業坊(ptt.cc), 來自: 36.230.77.139 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1700381819.A.740.html
推
11/19 19:21,
2年前
, 1F
11/19 19:21, 1F
→
11/19 19:57,
2年前
, 2F
11/19 19:57, 2F
→
11/19 23:49,
2年前
, 3F
11/19 23:49, 3F
→
11/19 23:50,
2年前
, 4F
11/19 23:50, 4F
→
11/19 23:55,
2年前
, 5F
11/19 23:55, 5F
→
11/19 23:56,
2年前
, 6F
11/19 23:56, 6F
→
11/19 23:58,
2年前
, 7F
11/19 23:58, 7F
→
11/19 23:58,
2年前
, 8F
11/19 23:58, 8F
推
11/20 13:22,
2年前
, 9F
11/20 13:22, 9F
→
11/20 14:35,
2年前
, 10F
11/20 14:35, 10F
→
11/20 15:21,
2年前
, 11F
11/20 15:21, 11F
→
11/21 15:37,
2年前
, 12F
11/21 15:37, 12F
→
11/21 16:04,
2年前
, 13F
11/21 16:04, 13F
推
11/25 12:02, , 14F
11/25 12:02, 14F
→
11/25 15:14, , 15F
11/25 15:14, 15F
※ 編輯: kino818 (36.230.71.237 臺灣), 11/26/2023 12:14:38
Python 近期熱門文章
PTT數位生活區 即時熱門文章
21
29