Update 2.0 (08.10.19) Setting TF_CPP_MIN_LOG_LEVEL should still work (see update v0. 12+ below), but there is currently an open problem (see Issue # 31870 ). If the TF_CPP_MIN_LOG_LEVEL setting TF_CPP_MIN_LOG_LEVEL not work for you (again, see below), try the following to set the log level:
import tensorflow as tf tf.get_logger().setLevel('INFO')
In addition, see the documentation for tf.autograph.set_verbosity for details on autograph log messages, for example:
v0. 12+ Update (05/20/17), work through TF 2. 0+:
In TensorFlow 0. 12+, for this problem , now you can control the registration through an environment variable called TF_CPP_MIN_LOG_LEVEL ; by default it is 0 (all logs are shown), but one of the following values in the Level column can be set.
Level | Level for Humans | Level Description -------|------------------|------------------------------------ 0 | DEBUG | [Default] Print all messages 1 | INFO | Filter out INFO messages 2 | WARNING | Filter out INFO & WARNING messages 3 | ERROR | Filter out all messages
See the following general OS example using Python:
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
To be precise, you can also set the level for the Python tf_logging module, which is used, for example, in. summary operations, tensor board, various ratings, etc.
For version 1.14, you will receive warnings if you do not switch to using API v1 as follows:
For previous versions of TensorFlow or TF-Learn Logging (v0.11.x or lower):See the page below for information on logging TensorFlow; with the new update, you can set the logging details to DEBUG , INFO , WARN , ERROR or FATAL . For instance:
tf.logging.set_verbosity(tf.logging.ERROR)
The page also displays monitors that can be used with TF-Learn models. Here is the page .
This does not block all logs (TF-Learn only). I have two solutions; one is the “technically correct” solution (Linux), and the other is a rebuild of TensorFlow.
script -c 'python [FILENAME].py' | grep -v 'I tensorflow/'
For reading, see this answer , which includes changing the source code and rebuilding TensorFlow.