Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] The keyword mode appears nested multiple times in the log #1305

Merged
merged 3 commits into from
Sep 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions mmengine/runner/log_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = f"{mode}/{log_cfg.pop('data_src')}"
log_name = f"{mode}/{log_cfg.pop('log_name', data_src)}"
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}'
# log item in custom_cfg could only exist in train or val
# mode.
if data_src in mode_history_scalars:
Expand Down
Loading