facebookresearch / detectron2

Detectron2 is a platform for object detection, segmentation and other visual recognition tasks.
https://detectron2.readthedocs.io/en/latest/
Apache License 2.0
30.26k stars 7.44k forks source link

Problems when I train my dataset with COCO format. #4068

Closed tangjiaxi98 closed 2 years ago

tangjiaxi98 commented 2 years ago

Label JPG files with labelme==5.0.1, translated to COCO format, and edit builtin.py and builtin_meta.py already. I think the problem is "[03/15 17:42:59 d2.data.build]: Removed 48 images with no usable annotations. 0 images left." How to fix it?Thanks.

2022-03-15 17-43-15 的屏幕截图

github-actions[bot] commented 2 years ago

You've chosen to report an unexpected problem or bug. Unless you already know the root cause of it, please include details about it by filling the issue template. The following information is missing: "Instructions To Reproduce the Issue and Full Logs"; "Your Environment";

tangjiaxi98 commented 2 years ago

Logs: [03/15 17:42:57] detectron2 INFO: Rank of current process: 0. World size: 1 [03/15 17:42:57] detectron2 INFO: Command line arguments: Namespace(config_file='configs/COCO-detection/faster_rcnn_R_101_FPN_base.yaml', dist_url='tcp://127.0.0.1:50152', end_iter=-1, eval_all=False, eval_during_train=False, eval_iter=-1, eval_only=False, machine_rank=0, num_gpus=1, num_machines=1, opts=None, resume=False, start_iter=-1) [03/15 17:42:57] detectron2 INFO: Contents of args.config_file=configs/COCO-detection/faster_rcnn_R_101_FPN_base.yaml: BASE: "../Base-RCNN-FPN.yaml" MODEL: WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-101.pkl" MASK_ON: False RESNETS: DEPTH: 101 ROI_HEADS: NUM_CLASSES: 3 #60 DATASETS: TRAIN: ('coco_train_base',) #('coco_trainval_base',) TEST: ('coco_test_base',) SOLVER: IMS_PER_BATCH: 2 #16 STEPS: (85,100) #(85000, 100000) MAX_ITER: 110 #110000 OUTPUT_DIR: "checkpoints/coco/faster_rcnn/faster_rcnn_R_101_FPN_base"

[03/15 17:42:57] detectron2 INFO: Full config saved to /media/hp/new/few-shot-object-detection-master/checkpoints/coco/faster_rcnn/faster_rcnn_R_101_FPN_base/config.yaml [03/15 17:42:57] d2.utils.env INFO: Using a generated random seed 57992449 [03/15 17:42:59] d2.data.build INFO: Removed 48 images with no usable annotations. 0 images left.

My Environment: I can run the train code successfully on PASCAL VOC dataset, so I don't think it is the environment that cause this problem.

DanielWuuuuuu commented 2 years ago

Hello! Excuse me, where is this set?

DATASETS: TRAIN: ('coco_train_base',) #('coco_trainval_base',) TEST: ('coco_test_base',)

ppwwyyxx commented 2 years ago

Removed 48 images with no usable annotations. 0 images left."

The logs say that the annotations are not recognized. So your annotations are not in the correct format.