需要在使用前加上: import tensorflow as tf tf.placeholder_with_default = tf.compat.v1.placeholder_with_default