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層時出錯:html

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

錯誤
錯誤

環境

  • keras cup版本
  • Anaconda

解決方法

找到以下圖路徑:
enterdescription here
修改506行:github

_LOCAL_DEVICES = tf.config.experimental_list_devices()

api

devices = tf.config.list_logical_devices()

_LOCAL_DEVICES = [x.name for x in devices]

參考

相關文章
相關標籤/搜索