From ae27dcd95fb2e4fb4b39a2fe6ddbfdfa1b55af36 Mon Sep 17 00:00:00 2001 From: Wenyu Date: Wed, 1 Jun 2022 11:08:24 +0800 Subject: [PATCH] fix train dataset get_anno (#6076) --- ppdet/engine/trainer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ppdet/engine/trainer.py b/ppdet/engine/trainer.py index 1829bf019..c180e2a31 100644 --- a/ppdet/engine/trainer.py +++ b/ppdet/engine/trainer.py @@ -218,13 +218,14 @@ class Trainer(object): # when do validation in train, annotation file should be get from # EvalReader instead of self.dataset(which is TrainReader) - anno_file = self.dataset.get_anno() - dataset = self.dataset if self.mode == 'train' and validate: eval_dataset = self.cfg['EvalDataset'] eval_dataset.check_or_download_dataset() anno_file = eval_dataset.get_anno() dataset = eval_dataset + else: + dataset = self.dataset + anno_file = dataset.get_anno() IouType = self.cfg['IouType'] if 'IouType' in self.cfg else 'bbox' if self.cfg.metric == "COCO": -- GitLab