如何去掉TensorFlow中烦人的warning和instruction to update:
尝试过:
import warnings
warnings.filterwarnings(“ignore”)
也尝试过:
import os
os.environ[“TF_CPP_MIN_LOG_LEVEL”] = ‘2’
但是对我来说都不管用,于是查了各种资料,可以尝试一下代码去除warning:
对于 TF 1.X版本
import tensorflow as tf
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
对于 TF 2.X版本