Browse Source

refine metric related code

will-jl944 4 năm trước cách đây
mục cha
commit
90366ff132
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      dygraph/paddlex/cv/models/detector.py

+ 1 - 1
dygraph/paddlex/cv/models/detector.py

@@ -336,7 +336,7 @@ class BaseDetector(BaseModel):
         """
 
         if metric is None:
-            if not hasattr(self, metric):
+            if not hasattr(self, 'metric'):
                 if eval_dataset.__class__.__name__ == 'VOCDetection':
                     self.metric = 'voc'
                 elif eval_dataset.__class__.__name__ == 'CocoDetection':