If you're working with Tensorflow 2.0, setting TF_CPP_MIN_LOG_LEVEL
should still work
You can disable all logs using os.environ:
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
Here,
0 = all messages are logged (default behavior)
1 = INFO messages are not printed
2 = INFO and WARNING messages are not printed
3 = INFO, WARNING, and ERROR messages are not printed
(The above is tested on TensorFlow 0.12 and 1.0)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…