tensorflow兼容处理--2.0版本中用到1.x版本中被deprecated的代码 用下面代码就可以轻松解决 import tensorflow.compat.v1 as tf tf.disable_v2_behavior()