Fix results tracking for metrics in multi-output case
@@ -680,11 +680,10 @@ class Model(Network):
y_true, y_pred, sample_weight=sample_weight)
if len(self.outputs) > 1:
- # TODO
- # update_ops = self._output_loss_metrics[i].update_state(output_loss)
- # self._metric_updates += update_ops
- if K.backend() == 'tensorflow':
- self._output_loss_metrics[i](output_loss)
+ update_ops = self._output_loss_metrics[i].update_state(output_loss)
+ self._metric_updates += update_ops
+ result = self._output_loss_metrics[i].result()
+ self._output_loss_metrics[i]._call_result = result
if total_loss is None:
total_loss = loss_weight * output_loss
