import osos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import tensorflow.compat.v1 as tftf.disable_v2_behavior()tf.logging.set_verbosity(tf.logging.ERROR) 顺序很重要