AttributeError: module ‘tensorflow_core._api.v2.config’ has no attribute ‘list_physical_devices’
应该是接口更新了,改成以下接口就不会报错了。
查看所有GPU
tf.config.experimental.list_physical_devices('GPU')
查看所有设备
tf.config.experimental.list_physical_devices(device_type=None)