From de5d5597e73d08da90e8d2ceebc4d00e64ccf3a4 Mon Sep 17 00:00:00 2001 From: yhcc Date: Mon, 20 Jun 2022 12:58:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dfitlogcallback=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0launch=5Ftime=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastNLP/core/callbacks/fitlog_callback.py | 2 +- fastNLP/core/callbacks/progress_callback.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fastNLP/core/callbacks/fitlog_callback.py b/fastNLP/core/callbacks/fitlog_callback.py index 35662539..19a8b476 100644 --- a/fastNLP/core/callbacks/fitlog_callback.py +++ b/fastNLP/core/callbacks/fitlog_callback.py @@ -44,7 +44,7 @@ class FitlogCallback(HasMonitorCallback): if get_global_rank() != 0: # 如果不是 global rank 为 0 ,需要关闭 fitlog fitlog.debug() super().on_after_trainer_initialized(trainer, driver) - fitlog.add_other('launch_time', os.environ['FASTNLP_LAUNCH_TIME']) + fitlog.add_other(name='launch_time', value=os.environ['FASTNLP_LAUNCH_TIME']) def on_sanity_check_end(self, trainer, sanity_check_res): super(FitlogCallback, self).on_sanity_check_end(trainer, sanity_check_res) diff --git a/fastNLP/core/callbacks/progress_callback.py b/fastNLP/core/callbacks/progress_callback.py index d1295682..c172a9a7 100644 --- a/fastNLP/core/callbacks/progress_callback.py +++ b/fastNLP/core/callbacks/progress_callback.py @@ -25,7 +25,7 @@ class ProgressCallback(HasMonitorCallback): def record_better_monitor(self, trainer, results): self.best_monitor_step = trainer.global_forward_batches self.best_monitor_epoch = trainer.cur_epoch_idx - self.best_results = results + self.best_results = self.itemize_results(results) def on_train_end(self, trainer): if self.best_monitor_epoch != -1: