Skip to content

Commit

Permalink
Fix validation loss logging (#1494)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfernezir authored Apr 22, 2022
1 parent e231583 commit 7553fbe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mmseg/models/segmentors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,14 @@ def val_step(self, data_batch, optimizer=None, **kwargs):
losses = self(**data_batch)
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,
log_vars=log_vars_,
num_samples=len(data_batch['img_metas']))

return outputs
Expand Down

0 comments on commit 7553fbe

Please sign in to comment.