mmyolo icon indicating copy to clipboard operation
mmyolo copied to clipboard

Results do not correspond to current coco set

Open EudicL opened this issue 1 year ago • 3 comments

Prerequisite

🐞 Describe the bug

Why does running the command report this error, but evaluating it in training is fine

‘python tools/test.py work_dir/ppyoloe.py work_dirs/ppyoloe/best_coco_bbox_mAP_epoch_230.pth’

assert set(annsImgIds) == (set(annsImgIds) & set(self.getImgIds())),
AssertionError: Results do not correspond to current coco set

Environment

pytorch1.8.1

Additional information

None

EudicL avatar Jan 26 '24 15:01 EudicL

@EudicL I got a similar error but during the evaluation in training YOLOv5, do you know why?

amira-essawy avatar Jan 31 '24 08:01 amira-essawy

I got a similar error during the inference of YOLOv8, too. Seems like a common problem.

mgh233 avatar Feb 13 '24 09:02 mgh233

In my case, it is reusing the val_evaluator and test_evaluator in old config. In that case, it loads ann file from coco dataset instead of my new dataset. Here is my solution, hope it would help.

# in the bottom of config file, add these lines
val_evaluator = dict(
    type="mmdet.CocoMetric",
    proposal_nums=(100, 1, 10),
    ann_file="Path/to/your/new_val.json",
    metric="bbox",
)
test_evaluator = val_evaluator

tarv33 avatar Apr 10 '24 11:04 tarv33