Closed fangxu622 closed 3 years ago
Hi @fangxu622 This is because test_mode =True
represents the test mode, it will ignore the label directly.
if self.test_mode:
return self.prepare_test_img(idx)
def prepare_test_img(self, idx):
"""Get testing data after pipeline.
Args:
idx (int): Index of data.
Returns:
dict: Testing data after pipeline with new keys introduced by \
pipeline.
"""
img_info = self.data_infos[idx]
results = dict(img_info=img_info)
if self.proposals is not None:
results['proposals'] = self.proposals[idx]
self.pre_pipeline(results)
return self.pipeline(results)
This is normal. What requirements are you trying to achieve?
Describe the bug CocoDataset returns error no "ann_info" key when test_mode =True, It's ok when test_mode= False
Code
Environment pytorch 1.81,mmcv 1.3.5 ,mmdet 2.13
Error traceback