How to redirect TensorFlow logging to a file?

后端 未结 4 860
无人及你
无人及你 2021-02-01 04:14

I\'m using TensorFlow-Slim, which has some useful logging printed out to console by tf.logging. I would like to redirect those loggings to a text file, but couldn\'

4条回答
  •  天涯浪人
    2021-02-01 04:34

    You are right, there are no knobs for you to do that.

    If you truly, positively, absolutely cannot live with that, tf.logging is based on python logging. So, import logging tf.logging._logger.basicConfig(filename='tensorflow.log', level=logging.DEBUG)

    Note that you are on your own on an unsupported path, and that behavior may break at anytime.

    You may also file a feature request at our github issue page.

提交回复
热议问题