"Starting training with params:\n{}\n\n".format(state))
def on_epoch_end(self, state):
for postifx, (k, v) in zip(["", "\n"], state.epoch_metrics.items()):
self.logger.info(f"{state.epoch} * Epoch ({k}) metrics: " +
self._get_metrics_string(v) + postifx)
After Change
"Starting training with params:\n{}\n\n".format(state))
def on_epoch_end(self, state):
if self.logger is not None:
for k, v in state.epoch_metrics.items():
self.logger.info(
f"{state.epoch} * Epoch ({k}) metrics: " +
self._get_metrics_string(v))
self.logger.info("\n")
@staticmethod
def _get_logger(log_filepath):
logger = logging.getLogger(log_filepath)