Tensorflow将不会使用GPU进行训练

时间:2020-06-22 15:58:40

标签: tensorflow

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

[名称:“ / device:CPU:0” device_type:“ CPU” memory_limit:268435456 化身{}化身:17555541905751991624,名称: “ / device:XLA_CPU:0” device_type:“ XLA_CPU” memory_limit:17179869184 位置{}化身:11478293108191884427 physical_device_desc: “设备:XLA_CPU设备”,名称:“ /设备:XLA_GPU:0” device_type: “ XLA_GPU” memory_limit:17179869184位置{}化身: 3939365441136531515 physical_device_desc:“设备:XLA_GPU设备”]

但是,如果我要求提供光学设备以确保它在那里,就可以

tf.config.list_physical_devices('GPU') 出[52]:[]

我正在尝试让TF进行训练并使用GPU,但我似乎无法使其正常工作。

> print("Num GPUs Available: ",
> len(tf.config.experimental.list_physical_devices('GPU'))) Num GPUs
> Available:  0

似乎上面的Tensorflow 2.1内置了gpu,因此围绕它的许多旧线程已过时。任何有关如何强制TensorFlow看到我的GPU并因此使用它的指针-如果看到gpu,则应该使用它。

0 个答案:

没有答案
相关问题