环境描述:Anaconda Tensorflow2.1
出现错误:
AttributeError: module 'tensorflow_core._api.v2.config' has no attribute 'experimental_list_devices'
解决办法:
按照错误内容找到tensorflow_backend.py 源文件的第506行,将
_LOCAL_DEVICES = tf.config.experimental_list_devices()
修改为
devices = tf.config.list_logical_devices()
_LOCAL_DEVICES = [x.name for x in devices]
即可解决问题。
参考:https://blog.csdn.net/caiguanhong/article/details/106317530