From e45130521f3f03d643c15c57f2898dec1dc18076 Mon Sep 17 00:00:00 2001 From: Erin Antono <10929462+eantono@users.noreply.github.com> Date: Tue, 24 Jan 2023 14:21:56 -0800 Subject: [PATCH] namespaced validation logs to prevent overwriting --- mmdet/models/detectors/base.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mmdet/models/detectors/base.py b/mmdet/models/detectors/base.py index bf64bce63e8..f87097b1b86 100644 --- a/mmdet/models/detectors/base.py +++ b/mmdet/models/detectors/base.py @@ -263,8 +263,13 @@ def val_step(self, data, optimizer=None): losses = self(**data) loss, log_vars = self._parse_losses(losses) + log_vars_ = dict() + for loss_name, loss_value in log_vars.items(): + k = loss_name + '_val' + log_vars_[k] = loss_value + outputs = dict( - loss=loss, log_vars=log_vars, num_samples=len(data['img_metas'])) + loss=loss, log_vars=log_vars_, num_samples=len(data['img_metas'])) return outputs