module 'tensorflow_core._api.v2.config' has no attribute 'experimental_list_devices'

报错如下

建立CNN层时出错:

module ‘tensorflow_core._api.v2.config’ has no attribute ‘experimental_list_devices’

module 'tensorflow_core._api.v2.config' has no attribute 'experimental_list_devices'
错误

环境

  • keras cup版本
  • Anaconda

解决方法

找到如下图路径:
module 'tensorflow_core._api.v2.config' has no attribute 'experimental_list_devices'
修改506行:

_LOCAL_DEVICES = tf.config.experimental_list_devices()

devices = tf.config.list_logical_devices()

_LOCAL_DEVICES = [x.name for x in devices]

参考

相关文章:

  • 2021-10-07
  • 2021-12-31
  • 2021-09-19
  • 2021-10-20
  • 2021-08-23
  • 2021-05-23
  • 2021-09-28
  • 2021-08-28
猜你喜欢
  • 2022-01-17
  • 2021-04-18
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2021-12-24
相关资源
相似解决方案