diff --git a/python/paddle/fluid/metrics.py b/python/paddle/fluid/metrics.py index 1301b6f9616dfdb86e8b54c7a764dd5c782f2316..7f9e958a8e21297d7e7bf7046a9738408a11b7a9 100644 --- a/python/paddle/fluid/metrics.py +++ b/python/paddle/fluid/metrics.py @@ -116,7 +116,7 @@ class CompositeMetric(MetricBase): super(CompositeMetric, self).__init__(name, kwargs) self._metrics = [] - def add_metric(self, metric): + def update(self, metric): if not isinstance(metric, MetricBase): raise ValueError("SubMetric should be inherit from MetricBase.") self._metrics.append(metric) @@ -280,6 +280,7 @@ class DetectionMAP(MetricBase): super(DetectionMAP, self).__init__(name) # the current map value self.value = .0 + self.weight = .0 def update(self, value, weight): if not _is_number_or_matrix_(value):