我在Ubuntu 18.04上使用Tensorflow 2.0。运行时
tf.config.list_physical_devices('GPU')
我收到上述错误。解决方法是什么?
最佳答案
运行tf.config.experimental.list_physical_devices('GPU')
查看所有GPU
或者
运行tf.config.experimental.list_physical_devices(device_type=None)
查看所有设备
您也可以使用tf.test.is_gpu_available()
。如果检测到可用的GPU,则说True。
关于tensorflow - AttributeError : module 'tensorflow_core._api.v2.config' has no attribute 'list_physical_devices' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59266150/