简体   繁体   English

tensorflow 2.2 gpu 支持 Windows

[英]tensorflow 2.2 gpu support Windows

I have the following output for我有以下输出

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"
]

What should l do in order to have GPU working on Windows?我应该怎么做才能让 GPU 在 Windows 上工作?

I have in the path the following in the PATH我在路径中有以下路径

C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.1\\bin C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.1\\libnvvp C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.1\\extras\\CUPTI\\lib64 C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v11.1\\include C:\\cuda\\bin 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 Computing Toolkit\\CUDA\\v11.1\\include C:\\cuda\\bin

I believe you need cuda v10.1 not 11.1.我相信你需要 cuda v10.1 而不是 11.1。 What I found easiest to do is uninstall tensorflow if you installed it with pip.我发现最简单的方法是卸载 tensorflow,如果你用 pip 安装它。 If you are using Anaconda then us conda to install tensorflow.如果您使用的是 Anaconda,那么我们使用 conda 来安装 tensorflow。 It will install version 2.1.1, the cuda toolkit version 10.1.243 and cudnn version 7.6.5.它将安装版本 2.1.1、cuda 工具包版本 10.1.243 和 cudnn 版本 7.6.5。 Note conda can only install tensorflow up to version 2.1.1.注意 conda 只能安装 tensorflow 到 2.1.1 版本。 If you want tensorflow 2.2 install it with pip using pip install tensorflow ==2.2.0.如果你想要 tensorflow 2.2 使用 pip install tensorflow ==2.2.0 安装它。 after you have installed 2.1.安装 2.1 后。 The cuda toolkit and cudnn work with version 2.2. cuda 工具包和 cudnn 适用于 2.2 版。 Otherwise you have to go through the process you used to install cuda 11.1 but this time use the 10.1 download files.否则,您必须执行用于安装 cuda 11.1 的过程,但这次使用 10.1 下载文件。 One other thing.另一件事。 Use python3.7 not 3.8.使用 python3.7 而不是 3.8。 Apparently when you install tensorflow with conda it will not work with 3.8.显然,当您使用 conda 安装 tensorflow 时,它不适用于 3.8。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM