module 'tensorflow_core._api.v2.config' has no attribute 'experimental_list_devices'
![](https://img2020.cnblogs.com/blog/1349636/202003/1349636-20200328171441844-1023880242.png)
报错如下
建立CNN层时出错:
module ‘tensorflow_core._api.v2.config’ has no attribute ‘experimental_list_devices’
![错误 错误](https://gitee.com/howbin/blog_image/raw/master/story/1585386779484.png)
错误
环境
- keras cup版本
- Anaconda
解决方法
找到如下图路径:
修改506行:
_LOCAL_DEVICES = tf.config.experimental_list_devices()
为
devices = tf.config.list_logical_devices()
_LOCAL_DEVICES = [x.name for x in devices]