Just for the record, please skip it.
Solution:
1. Check the version of tensorflow:
import tensorflow as tf #载入tensorflow环境
print(tf.__version__) #查看tensorflow版本
If it is version 2.
2. Change "import tensorflow as tf" to
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()