Tensorflow GPU 无法识别我的 GPU

Tensorflow GPU 无法识别我的 GPU

问题描述:

我一直在尝试使用 Tensorflow GPU,但显然,Tersorflow 无法识别我的 GPU.

I have been trying to use Tensorflow GPU, but apparently, Tersorflow is not identifying my GPUs.

当我跑步时:

from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())

作为输出,只显示我的 CPU.我已经检查了所有版本的所有内容,它们似乎兼容.我有带有 CUDA Toolkit、cuDNN 7.5 和 Tensorflow 1.13.1 的 CUDA 10.1.我在 Ubuntu 18.xx 上运行所有内容

As an output, only my CPU shows up. I have checked all of the versions of everything and they seem to be compatible. I have CUDA 10.1 with CUDA Toolkit, cuDNN 7.5 and Tensorflow 1.13.1. I am running everything on Ubuntu 18.xx

我做错了什么?

什么是输出:

from tensorflow.python.client import device_lib

device_lib.list_local_devices()

在我的系统上,tensorflow 无法识别 GPU,因为它是一个 XLA_GPU.我不太确定为什么 XLA_GPU 不是 GPU,似乎在 tensorflow-gpu 代码中某处缺少 OR 语句.

On my system, tensorflow is not recognizing GPU because it is a XLA_GPU. I'm not really sure why a XLA_GPU is not also a GPU, seems there is a OR statement missing somewhere in the tensorflow-gpu code.

如果上面的代码没有列出任何 GPU(而你有一个):

If above code does not list any GPUs (and you have one):

pip uninstall tensorflow
pip uninstall tensorflow-gpu
pip install tensorflow-gpu 

...为我工作.