【问题标题】:How to know on which GPU tensorflow model is training on如何知道在哪个 GPU tensorflow 模型上进行训练
【发布时间】:2021-10-16 10:08:58
【问题描述】:

我已安装 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

【问题讨论】:

    标签: python-3.x tensorflow gpu tensorflow2.0


    【解决方案1】:

    尝试启用调试:

    tf.debugging.set_log_device_placement(True)
    

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

    【讨论】:

    • 感谢您的回答。如何确认 Intel GPU 被忽略?
    • Tensorflow 使用 CUDA,这意味着仅支持 NVIDIA GPU。
    猜你喜欢
    • 2020-11-27
    • 2021-04-19
    • 1970-01-01
    • 2021-05-28
    • 2020-08-13
    • 2020-10-16
    • 1970-01-01
    • 1970-01-01
    • 2021-04-24
    相关资源
    最近更新 更多