【问题标题】:tensorflow 2.2 gpu support Windowstensorflow 2.2 gpu 支持 Windows
【发布时间】:2021-02-04 21:09:50
【问题描述】:

我有以下输出

import tensorflow as tf
print(tf.__version__)
print(tf.test.is_gpu_available())
print(tf.config.list_physical_devices('GPU'))
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
2.2.0
False
[]
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 9877499202779451731
, name: "/device:XLA_CPU:0"
device_type: "XLA_CPU"
memory_limit: 17179869184
locality {
}
incarnation: 5902815618689871957
physical_device_desc: "device: XLA_CPU device"
, name: "/device:XLA_GPU:0"
device_type: "XLA_GPU"
memory_limit: 17179869184
locality {
}
incarnation: 9480702146652446076
physical_device_desc: "device: XLA_GPU device"
]

我应该怎么做才能让 GPU 在 Windows 上工作?

我在 PATH 中有以下路径

C:\Program Files\NVIDIA GPU 计算工具包\CUDA\v11.1\bin C:\Program Files\NVIDIA GPU 计算工具包\CUDA\v11.1\libnvvp C:\Program Files\NVIDIA GPU 计算工具包\CUDA\v11.1\extras\CUPTI\lib64 C:\Program Files\NVIDIA GPU 计算工具包\CUDA\v11.1\include C:\cuda\bin

【问题讨论】:

    标签: windows tensorflow gpu


    【解决方案1】:

    我相信您需要 cuda v10.1 而不是 11.1。如果你用 pip 安装了 tensorflow,我发现最容易做的是卸载它。如果您使用的是 Anaconda,那么我们使用 conda 来安装 tensorflow。它将安装版本 2.1.1、cuda 工具包版本 10.1.243 和 cudnn 版本 7.6.5。注意 conda 只能安装 tensorflow 到 2.1.1 版本。如果你想要 tensorflow 2.2 使用 pip install tensorflow ==2.2.0 安装它。安装 2.1 后。 cuda 工具包和 cudnn 适用于 2.2 版。否则,您必须完成安装 cuda 11.1 的过程,但这次使用 10.1 下载文件。另一件事。使用 python3.7 而不是 3.8。显然,当您使用 conda 安装 tensorflow 时,它不适用于 3.8。

    【讨论】:

    猜你喜欢
    • 2018-05-19
    • 1970-01-01
    • 2018-04-13
    • 2019-10-04
    • 2020-05-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多