近期幫朋友使用tensorflow訓(xùn)練了一套模型聘鳞,使用的是tensorflow诡宗。 因?yàn)樗夭谋容^大的問題两波,所以這里特地的使用了gpu訓(xùn)練瞳步,也是做了一些自己沒做過的東西。
1.安裝環(huán)境
????電腦環(huán)境:windows10
????python版本: 3.7.0
????gpu配置: NVDIA GeForce GTX 750
2.安裝過程
首先呢腰奋,創(chuàng)建一個(gè)虛擬環(huán)境单起,我這邊使用的是anaconda
#創(chuàng)建虛擬環(huán)境
conda create -n tensorflowEnv python=3.7.0
# 進(jìn)入虛擬環(huán)境
activate tensorflowEnv
# 安裝 tensorflow-directml-plugin 這是一個(gè)windows平臺(tái)使用的Gpu插件
pip install tensorflow-directml-plugin -i?https://pypi.tuna.tsinghua.edu.cn/simple
# 接下來輸入 在python程序中檢測一下gpu是否可用即可。
python
import tensorflow as tf
tf.config.list_physical_devices
3 測試結(jié)果
? ??????
4 遇到的錯(cuò)誤
? ??????????ERROR: Cannot uninstall ‘wrapt‘. It is a distutils installed project and thus we cannot accurat
這個(gè)錯(cuò)誤是因?yàn)閣rapt包是dbUtils使用的劣坊,而tensorflow包嘀倒,是需要使用到指定版本的wrapt的,所以這里需要卸載重裝的原因局冰。只需要在安裝tensorflow排除這個(gè)包即可测蘑。
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.1.0h 27 Mar 2018'. See: https://github.com/urllib3/urllib3/issues/2168
這個(gè)錯(cuò)誤是因?yàn)檎f,我這邊anaconda創(chuàng)建的python環(huán)境自帶的基礎(chǔ)包版本不匹配的原因康二,這邊只需要沖尋裝一下urllib3即可碳胳。 我這邊指定版本為1.15.0。