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


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’

错误
错误

环境

  • keras cup版本
  • Anaconda

解决方法

找到如下图路径:
enterdescription here
修改506行:

_LOCAL_DEVICES = tf.config.experimental_list_devices()

devices = tf.config.list_logical_devices()

_LOCAL_DEVICES = [x.name for x in devices]

参考


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM