作者:桃Z夭夭 | 来源:互联网 | 2024-09-30 19:46
运行以下代码fromtensorflow.python.clientimportdevice_libprint(device_lib.list_local_devices())
运行以下代码
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
若出现以下CPU、GPU信息,说明环境配置没问题,享受GPU带来的加速吧
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 13915861037942189575
, name: "/device:GPU:0"
device_type: "GPU"
memory_limit: 1476712857
locality {bus_id: 1links {}
}
incarnation: 955197386324155545
physical_device_desc: "device: 0, name: GeForce 940M, pci bus id: 0000:01:00.0, compute capability: 5.0"
]