From c03ed7e8855ecff4f6b8883c72220df5c14480d3 Mon Sep 17 00:00:00 2001 From: huaibovip <53330216+huaibovip@users.noreply.github.com> Date: Mon, 14 Aug 2023 01:06:40 +0000 Subject: [PATCH 1/3] fix log_processor.py --- mmengine/runner/log_processor.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mmengine/runner/log_processor.py b/mmengine/runner/log_processor.py index d3f9d95714..83b05da525 100644 --- a/mmengine/runner/log_processor.py +++ b/mmengine/runner/log_processor.py @@ -377,12 +377,11 @@ def _collect_scalars(self, tag[key] = mode_history_scalars[key].current() # Update custom keys. for log_cfg in custom_cfg: - if not reserve_prefix: - data_src = log_cfg.pop('data_src') - log_name = f"{log_cfg.pop('log_name', data_src)}" - else: + data_src = log_cfg.pop('data_src') + log_name = log_cfg.pop('log_name', data_src) + if reserve_prefix: data_src = f"{mode}/{log_cfg.pop('data_src')}" - log_name = f"{mode}/{log_cfg.pop('log_name', data_src)}" + log_name = f"{mode}/{log_cfg.pop('log_name')}" # log item in custom_cfg could only exist in train or val # mode. if data_src in mode_history_scalars: From 73a9cd3c5b0bcc9aebc6eb88135fe6c332fa79df Mon Sep 17 00:00:00 2001 From: huaibovip <53330216+huaibovip@users.noreply.github.com> Date: Mon, 14 Aug 2023 09:20:08 +0800 Subject: [PATCH 2/3] Update log_processor.py --- mmengine/runner/log_processor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmengine/runner/log_processor.py b/mmengine/runner/log_processor.py index 83b05da525..7fe134c221 100644 --- a/mmengine/runner/log_processor.py +++ b/mmengine/runner/log_processor.py @@ -380,8 +380,8 @@ def _collect_scalars(self, data_src = log_cfg.pop('data_src') log_name = log_cfg.pop('log_name', data_src) if reserve_prefix: - data_src = f"{mode}/{log_cfg.pop('data_src')}" - log_name = f"{mode}/{log_cfg.pop('log_name')}" + data_src = f"{mode}/{data_src}" + log_name = f"{mode}/{log_name}" # log item in custom_cfg could only exist in train or val # mode. if data_src in mode_history_scalars: From 1eb82509b1a1a3478df1b963c50c95841c70c8c3 Mon Sep 17 00:00:00 2001 From: huaibovip <53330216+huaibovip@users.noreply.github.com> Date: Wed, 16 Aug 2023 16:00:52 +0000 Subject: [PATCH 3/3] fix lint errors in last commit --- mmengine/runner/log_processor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmengine/runner/log_processor.py b/mmengine/runner/log_processor.py index 7fe134c221..c225420324 100644 --- a/mmengine/runner/log_processor.py +++ b/mmengine/runner/log_processor.py @@ -380,8 +380,8 @@ def _collect_scalars(self, data_src = log_cfg.pop('data_src') log_name = log_cfg.pop('log_name', data_src) if reserve_prefix: - data_src = f"{mode}/{data_src}" - log_name = f"{mode}/{log_name}" + data_src = f'{mode}/{data_src}' + log_name = f'{mode}/{log_name}' # log item in custom_cfg could only exist in train or val # mode. if data_src in mode_history_scalars: