如何在没有分配的情况下列出可见的 Tensorflow 设备?
How to list visible Tensorflow devices without allocation?
可以通过以下方式列出当前对 Tensorflow 可见的设备:
from tensorflow.python.client import device_lib
LOCAL_DEVICES = device_lib.list_local_devices()
(参见:)
但是,这似乎是对这些 GPU 进行初始化和分配。我们如何在不分配设备的情况下列出设备?
可以通过以下方式列出当前对 Tensorflow 可见的设备:
from tensorflow.python.client import device_lib
LOCAL_DEVICES = device_lib.list_local_devices()
(参见:
但是,这似乎是对这些 GPU 进行初始化和分配。我们如何在不分配设备的情况下列出设备?