当前位置: 代码迷 >> 综合 >> module ‘tensorflow.compat.v2.__internal__‘ has no attribute ‘register_clear_session_function‘ 解决方法
  详细解决方案

module ‘tensorflow.compat.v2.__internal__‘ has no attribute ‘register_clear_session_function‘ 解决方法

热度:0   发布时间:2023-12-29 00:05:55.0

错误import:

from tensorflow import keras
from keras.preprocessing import image

正确import:

from tensorflow import keras
from tensorflow.keras.preprocessing import image

原因:

目前版本的keras已完全并入tensorflow,并将tensorflow作为自身后台进行实现与运行

  相关解决方案