AttributeError: module ‘tensorflow.compat.v2.internal‘ has no attribute ‘register_clear_session_func

报错异常:AttributeError: module 'tensorflow.compat.v2.internal' has no attribute 'register_clear_session_function'

原因:keras和tensorflow版本不对应,重新下keras

解决方案:

重新下载对应版本的keras,因为我的tensor是2.5版本,因此下的是2.5的keras,如果是2.4的话只要下keras==2.4.0或者2.4.3版本就行

pip install keras=2.5.0rc0 -i https://pypi.tuna.tsinghua.edu.cn/simple/

你可能感兴趣的:(踩坑记录,tensorflow)