#python
import
os import tensorflow as tf os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # or any {'0', '1', '3'}
#C++: (In Terminal)

export TF_CPP_MIN_LOG_LEVEL=2

TF_CPP_MIN_LOG_LEVEL默认值为 0 (显示所有logs),设置为 1 隐藏 INFO logs, 2 额外隐藏WARNING logs, 设置为3所有 ERROR logs也不显示。