diff --git a/mmseg/models/segmentors/base.py b/mmseg/models/segmentors/base.py index 9b22a7ca9b..76dc8f075a 100644 --- a/mmseg/models/segmentors/base.py +++ b/mmseg/models/segmentors/base.py @@ -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