Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does that code snippet signify "tf.logging.set_verbosity(tf.logging.INFO)" in tensorflow code?

I have seen many usage of that line of code in many tensorflow projects. What does the line do in tensorflow?

like image 302
kks Avatar asked Jun 27 '18 05:06

kks


2 Answers

The logging level documentation page basically tells you: If you set it to the level as displayed (INFO), then TensorFlow will tell you all messages that have the label INFO (or more critical).

Say you would only be interested in WARN or ERROR, then you could similarly set tf.logging.set_verbosity(tf.logging.WARN)

like image 80
dennlinger Avatar answered Nov 12 '22 17:11

dennlinger


It is easier to try this yourself. I use Pycharm IDE and it captures the output.

import tensorflow as tf

tf.logging.set_verbosity(tf.logging.DEBUG)
#tf.logging.set_verbosity(tf.logging.INFO) 
# Other settings

tf.logging.debug('Debug')
tf.logging.info('info')
tf.logging.warn('warn')
tf.logging.error('error')
tf.logging.fatal('fatal')
like image 29
Mohan Radhakrishnan Avatar answered Nov 12 '22 18:11

Mohan Radhakrishnan