mmyolo
mmyolo copied to clipboard
Results do not correspond to current coco set
Prerequisite
- [X] I have searched the existing and past issues but cannot get the expected help.
- [X] I have read the FAQ documentation but cannot get the expected help.
- [X] The bug has not been fixed in the latest version.
🐞 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 I got a similar error but during the evaluation in training YOLOv5, do you know why?
I got a similar error during the inference of YOLOv8, too. Seems like a common problem.
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