检测 TensorFlow 是否调用 GPU

import tensorflow as tf

if tf.config.list_physical_devices("GPU"):
    print("TensorFlow is using the GPU")
else:
    print("TensorFlow is using the CPU")

print(tf.config.list_physical_devices("GPU"))  # 打印可用的 GPU 设备列表


检测 TensorFlow 是否调用 GPU
http://localhost:8090/archives/check-tensorflow-gpu
作者
Administrator
发布于
2025年03月19日
许可协议