Gary Sieling

Tensorflow- where do log files go?

In order for Tensorflow logs to go somewhere, you need to register a handler.

From1

import logging

log = logging.getLogger('tensorflow')
log.setLevel(logging.DEBUG)

formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')

fh = logging.FileHandler('tensorflow' + datetime.now().strftime("%Y%m%d%H%M%S") +'.log')
fh.setLevel(logging.DEBUG)
fh.setFormatter(formatter)
log.addHandler(fh)
  1. https://stackoverflow.com/questions/40559667/how-to-redirect-tensorflow-logging-to-a-file []
Exit mobile version