tensorflow报错AttributeError: module ‘tensorflow.compat.v2‘ has no attribute ‘__internal__‘

tensorflow和keras版本不对应问题

先卸载tensorflow和keras

pip uninstall tensorflow
pip uninstall keras

安装指定版本tensorflow和keras

pip3 install tensorflow==2.2 -i https://pypi.tuna.tsinghua.edu.cn/simple

Installing collected packages: tensorflow
Successfully installed tensorflow-2.2.0

pip3 install keras==2.2 -i https://pypi.tuna.tsinghua.edu.cn/simple

Successfully installed keras-2.2.0 keras-applications-1.0.2 keras-preprocessing-1.0.1 pyyaml-6.0

你可能感兴趣的:(问题解决方案集锦,tensorflow,深度学习,人工智能)