Tensorflow logging messages do not appear

后端 未结 4 1007
情话喂你
情话喂你 2021-02-09 07:49

I use tensorflow 1.2.0 installed with pip install.

When I run samples that include

import logging
tf.logging.set_verbosity(tf.         


        
4条回答
  •  暖寄归人
    2021-02-09 08:18

    What I usually do to control the TensorFlow logging is to have this piece of code before any TensorFlow import

    import os
    import logging
    os.environ['TF_CPP_MIN_LOG_LEVEL'] = '0'
    logging.getLogger("tensorflow").setLevel(logging.WARNING)
    
    import tensorflow as tf
    

    I'd be happy to hear about any better solution.

提交回复
热议问题