您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

{AttributeError:模块'tensorflow_core._api.v2.config'没有属性'experimental_list_devices'}我如何解决此错误?

{AttributeError:模块'tensorflow_core._api.v2.config'没有属性'experimental_list_devices'}我如何解决此错误?

在这里找到了答案-https: //github.com/keras- team/keras/issues/13684。我load_model()在Anaconda的keras遇到了同样的问题:

AttributeError:模块“ tensorflow_core._api.v2.config”没有属性“ experimental_list_devices”

我发现问题的根源

… \ anaconda3 \ envs \ tf_env \ Lib \ site-packages \ keras \ backend \ 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]

而且有效

其他 2022/1/1 18:41:10 有403人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶