【问题标题】:AttributeError: module 'tensorflow_core._api.v2.config' has no attribute 'list_physical_devices'AttributeError:模块“tensorflow_core._api.v2.config”没有属性“list_physical_devices”
【发布时间】:2020-04-03 13:49:33
【问题描述】:

我在 Ubuntu 18.04 上使用 Tensorflow 2.0。正在运行

tf.config.list_physical_devices('GPU')

我收到上述错误。解决方法是什么?

【问题讨论】:

    标签: tensorflow tensorflow2.0


    【解决方案1】:

    运行 tf.config.experimental.list_physical_devices('GPU') 以查看所有 GPU

    或

    运行tf.config.experimental.list_physical_devices(device_type=None)查看所有设备

    您也可以使用tf.test.is_gpu_available()。如果检测到可用的 gpu,它会显示 True。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-05
      • 2020-07-04
      • 2021-09-24
      • 2020-10-03
      • 2021-10-08
      • 2021-03-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多