facebookresearch / facebookresearch/detectron2
Raise error "RPN requires gt_instances in training" when training with unlabeled images.
- Dominant language
- Python
- Stars
- 34.7k
- Forks
- 7.9k
- PR merge metrics
- No merged PRs in 30d
Description
Hello
i am trying to add unlabeled images when training maskrcnn, i have added "annotations" as a empty list and set "cfg.DATALOADER.FILTER_EMPTY_ANNOTATIONS = False". finally i got the error "RPN requires gt_instances in training" .
am i doing a wrong way to put unlabeled images involving the training? if someone help me out , thanks in advance.
#############My environment:

############# Instructions To Reproduce the Issue:
1、my oraginal json file like this one(only have images with labels):

2、then i add unlabeled images's id,height....at "images" part in step one json file, the "annotation" part in this step are not changed.

ps: my trian data file as below:


3、after that i change the load_coco_json function in coco.py to allow "annotation" has empty list for unlabeles images when register my train data:
register part in my train.py

rewrite load_coco_json function in coco.py to allow "annotation" has empty list for unlabeles images

4、then i find in data_mapper.py needs recompute boxes, and the unlabed images have not gt_masks and gt_boxes. thus i changed recompute boxes part and mute filter_empty_instances( ) function which shows below:

5、finally, i set "cfg.DATALOADER.FILTER_EMPTY_ANNOTATIONS = False"
6、when i am training ,the output as below:


Contributor guide
Assessment
This issue has not been assessed yet.