diff --git a/ppdet/engine/trainer.py b/ppdet/engine/trainer.py index 1829bf019a8ca804d337f25817fcdf3b34b03325..c180e2a31bd6011cacdb7624066ad74d04d0b8fd 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":