transfiner icon indicating copy to clipboard operation
transfiner copied to clipboard

AssertionError: COCOAPI does not support empty polygons

Open W-hary opened this issue 2 years ago • 2 comments

The following error occurs when training a custom dataset

1692994856764

W-hary avatar Aug 25 '23 20:08 W-hary

Hello, Do you solve the problem?

liyanhhh avatar Dec 29 '23 01:12 liyanhhh

This issue generally occurs as an error that interrupts the training code after running for a period of time. Although I searched on GitHub and found some people encountering the same problem, there were no useful results to refer to. I suspected that there might be a problem with my own dataset. However, my dataset can run smoothly on mmdetection. Meanwhile, the error occurred in the file detectron2/structures/masks.py. So I investigated the masks.py in both mmdetection and detectron2, and indeed found that the statement "assert len(polygons) > 0, "COCOAPI does not support empty polygons"" was not present in mmdetection and detectron2. Instead, it was replaced by other statements in mmdetection and detectron2. After replacing the statement with the corresponding one from mmdetection and detectron2, the error no longer occurred, and the training proceeded smoothly.

first u should comment the following code,then add new codes in following picture

#assert len(polygons) > 0, "COCOAPI does not support empty polygons" #To comment out this line

image

CHN-001 avatar Mar 15 '24 07:03 CHN-001