diff --git a/python/paddle/fluid/metrics.py b/python/paddle/fluid/metrics.py index dfe8259139d37ae182676484f852993df501dd9c..c7c82f28e7c441b4aa24ffa81a8695e565d737d8 100644 --- a/python/paddle/fluid/metrics.py +++ b/python/paddle/fluid/metrics.py @@ -243,6 +243,7 @@ class Precision(MetricBase): raise ValueError("The 'labels' must be a numpy ndarray.") sample_num = labels.shape[0] preds = np.rint(preds).astype("int32") + for i in range(sample_num): pred = preds[i] label = labels[i]