一、环境介绍: 二、问题揪出: 运行tensorflow代码的时候,切换了tf-gpu环境,报了这个错误:AttributeError: module ‘tensorflow_core.compat.v2’ has no attribute ‘internal’ 三、解决措施: 发现报错定位在from keras.callbacks import *, 此刻将代码改成如下即可运行,亲测有效: from tensorflow.keras.callbacks import *