进入tf环境中下面的代码 import tensorflow as tf 替换成下面代码。 import tensorflow.compat.v1 as tf tf.disable_v2_behavior()