tensorflow2兼容tensorflow1 替换代码: import tensorflow as tf 修改为: import tensorflow.compat.v1 as tf tf.disable_v2_behavior()