From 99ad5a84ae1f63881a9a6e1cc2bfa5b30494eac2 Mon Sep 17 00:00:00 2001 From: wangguanzhong Date: Mon, 18 Jan 2021 14:53:58 +0800 Subject: [PATCH] fix_eval, test=dygraph (#2082) --- dygraph/ppdet/engine/trainer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dygraph/ppdet/engine/trainer.py b/dygraph/ppdet/engine/trainer.py index 691c92c6a..b32d74a8c 100644 --- a/dygraph/ppdet/engine/trainer.py +++ b/dygraph/ppdet/engine/trainer.py @@ -97,8 +97,8 @@ class Trainer(object): def _init_metrics(self): if self.mode == 'eval': if self.cfg.metric == 'COCO': - mask_resolution = self.model.mask_post_process.mask_resolution if hasattr( - self.model, 'mask_post_process') else None + mask_resolution = self.model.mask_post_process.mask_resolution if getattr( + self.model, 'mask_post_process', None) else None self._metrics = [ COCOMetric( anno_file=self.dataset.get_anno(), -- GitLab