为什么 tensorflow 的“list_local_devices”和“list_physical_devices”检测不到我的 GPU?

时间:2021-05-14 16:57:19

标签: python tensorflow anaconda

我正在使用带有 tensorflow-gpu 的 Anaconda 环境。我有一个带有最新驱动程序的 GTX 1050TI。我还安装了 CUDA 10.1 和 cuDNN(与 CUDA 10.1 兼容的版本)。但是由于某种原因,tensorflow 没有检测到我的 GPU。

代码:

import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))

输出: 可用的 GPU 数量:0

代码:

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

输出:

[名称:“/设备:CPU:0” 设备类型:“CPU” 内存限制:268435456 地点{ } 化身:15520470840604058286 ] 2021-05-14 22:04:35.496144: I tensorflow/core/platform/cpu_feature_guard.cc:142] 这个 TensorFlow 二进制文件使用 oneAPI 深度神经网络库 (oneDNN) 进行了优化,以在性能关键操作中使用以下 CPU 指令: AVX 要在其他操作中启用它们,请使用适当的编译器标志重建 TensorFlow。

进程结束,退出代码 0

0 个答案:

没有答案