如何知道在哪个 GPU 上训练张量流模型

How to know on which GPU tensorflow model is training on

我已安装 tensorflow-gpu 以在 GPU 上训练我的模型,并已从下方确认安装。

import tensorflow as tf
tf.config.list_physical_devices()

#[PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU'),
# PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]

我开始训练图像分类模型,我希望它 运行 在 GPU 上自动运行,除非在设备上手动指定为 运行。但是在训练模型时,我可以在任务管理器中看到有 2 个 GPU,Intel Graphics card 是 GPU 0,NVIDIA GeForce GTX1660Ti 是 GPU1。这是否意味着 tensorflow 没有检测到我的 NVIDIA 卡,或者它是检测到的实际 GPU?

在训练模型时,我发现我的 NVIDIA GPU 利用率非常低。不确定我的模型是在哪个设备上训练的。

有人可以澄清一下吗。

更多版本详情。 tf.__version__ (2.6.0)python 3.7CUDA 11.4cudnn 8.2

尝试启用调试:

tf.debugging.set_log_device_placement(True)

我认为 tf.config.list_physical_devices() 忽略了您的 Intel GPU。