Skip to content

Commit

Permalink
[Fix]: Fix logging of validation loss (#9663)
Browse files Browse the repository at this point in the history
  • Loading branch information
eantono authored Jan 28, 2023
1 parent 08f77b5 commit fd76d2b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mmdet/models/detectors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fd76d2b

Please sign in to comment.