Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Results do not correspond to current coco set #18

Open
brosscle opened this issue Aug 2, 2023 · 1 comment
Open

Results do not correspond to current coco set #18

brosscle opened this issue Aug 2, 2023 · 1 comment

Comments

@brosscle
Copy link

brosscle commented Aug 2, 2023

Hi,
First, thanks for your really nice tutorial!
I tried to reproduce it and raised an error at the call to the function evaluate, at the end of the training loop:

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

After exploring, I managed to fix it by replacing the line 100 in the engine.py script.
I replaced
res = {target["image_id"]: output for target, output in zip(targets, outputs)}
by the line
res = {(target["image_id"]).tolist()[0]: output for target, output in zip(targets, outputs)}

The newline cast the image_id (formerly a tensor du to the ClassDataset definition) into an int, to match the id of the coco_evaluator.
Not sure if it was the best way to fix this issue but it might be enough, and it could help another one facing this issue !

@EricTweedle
Copy link

I had the same issue and the solution here solved it for me #12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants