yuhangzang / OV-DETR

[Under preparation] Code repo for "Open-Vocabulary DETR with Conditional Matching" (ECCV 2022)
202 stars 20 forks source link

Segmentation annotation error during training Instance Segmentation #21

Closed bradduy closed 1 year ago

bradduy commented 1 year ago

Thanks for your implementation,

I have successfully trained Object Detection with COCO based on your code. But when I continued to train instance segmentation --mask, I met the error:

    segmentations = [obj["segmentation"] for obj in anno]
KeyError: 'segmentation'

My solution is adding if condition: segmentations = [obj["segmentation"] for obj in anno if "segmentation" in obj] But at the line: masks = masks[keep]

There is new error: IndexError: The shape of the mask [4] at index 0 does not match the shape of the indexed tensor [3, 480, 640] at index 0

So why does the first error appear? And How can I fix this error?

Thank you a lot.