win10 安裝 tensorflow-gpu 2.10.0
系統(tǒng)配置
系統(tǒng) win10 x64
顯卡 GTX 1660 Ti
CUDA 12.2
cudnn 8.9
查看版本對(duì)應(yīng):
https://tensorflow.google.cn/install/source_windows#gpu
Version | Python version | Compiler | Build tools | cuDNN | CUDA |
---|---|---|---|---|---|
tensorflow_gpu-2.10.0 | 3.7-3.10 | MSVC 2019 | Bazel 5.1.1 | 8.1 | 11.2 |
這里查看我系統(tǒng)配置
我安裝 python 3.10 和 tensorflow_gpu-2.10.0
安裝 conda
安裝cuda
安裝python3.10
conda create -p D:\tensorEnv python=3.10
激活虛擬環(huán)境
conda activate D:\tensorEnv
安裝cuda
這里根據(jù)自己的版本安裝,按照表格推薦 11.2 ,我這里是12.2
conda install cudatoolkit=12.2
安裝cudnn
這里根據(jù)自己的版本安裝,按照表格推薦 8.1 ,我這里是 8.9
conda install cudnn=8.9
安裝tensorflow的GPU版本
這里根據(jù)自己的版本安裝,按照表格推薦tensorflow-gpu==2.10.0
(D:\tensorEnv) C:\Users\mingxingwang> python -m pip install tensorflow-gpu==2.10.0
測(cè)試 test-gpu.py
import tensorflow as tf
# print(tf.test.is_gpu_available())
print(tf.config.list_physical_devices('GPU'))
(D:\tensorEnv) C:\Users\mingxingwang> python test-gpu.py
輸出
[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
參考:
適用于Microsoft窗口的 CUDA 安裝指南 https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/
cuDNN Archive https://developer.nvidia.com/rdp/cudnn-archive文章來源:http://www.zghlxwxcb.cn/news/detail-631487.html
Build a TensorFlow pip package from source and install it on Windows https://tensorflow.google.cn/install/source_windows#gpu文章來源地址http://www.zghlxwxcb.cn/news/detail-631487.html
到了這里,關(guān)于win10 安裝 tensorflow-gpu 2.10.0的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!