NVlabs / DiscoBox

The Official PyTorch Implementation of DiscoBox.
https://arxiv.org/abs/2105.06464
Other
96 stars 9 forks source link

one question about IndexError: list index out of range,i want use my coco data ,but show this question,I hope you can help me. #7

Closed LiBiGo closed 2 years ago

LiBiGo commented 2 years ago

I only modify config about my coco data,

@DATASETS.register_module()
class CocoDataset(CustomDataset):
    CLASSES = ('air-hole', 'bite-edge', 'broken-arc', 'crack', 'hollow-bead', 'overlap',
               'slag-inclusion', 'unfused')
    # CLASSES = ('person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
    #            'train', 'truck', 'boat', 'traffic light', 'fire hydrant',
    #            'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog',
    #            'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe',
    #            'backpack', 'umbrella', 'handbag', 'tie', 'suitcase', 'frisbee',
    #            'skis', 'snowboard', 'sports ball', 'kite', 'baseball bat',
    #            'baseball glove', 'skateboard', 'surfboard', 'tennis racket',
    #            'bottle', 'wine glass', 'cup', 'fork', 'knife', 'spoon', 'bowl',
    #            'banana', 'apple', 'sandwich', 'orange', 'broccoli', 'carrot',
    #            'hot dog', 'pizza', 'donut', 'cake', 'chair', 'couch',
    #            'potted plant', 'bed', 'dining table', 'toilet', 'tv', 'laptop',
    #            'mouse', 'remote', 'keyboard', 'cell phone', 'microwave',
    #            'oven', 'toaster', 'sink', 'refrigerator', 'book', 'clock',
    #            'vase', 'scissors', 'teddy bear', 'hair drier', 'toothbrush')

question:



Traceback (most recent call last):
  File "tools/train.py", line 191, in <module>
    main()
  File "tools/train.py", line 187, in main
    meta=meta)
  File "/root/DiscoBox/mmdet/apis/train.py", line 172, in train_detector
    runner.run(data_loaders, cfg.workflow)
  File "/root/.local/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 125, in run
    epoch_runner(data_loaders[i], **kwargs)
  File "/root/.local/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 54, in train
    self.call_hook('after_train_epoch')
  File "/root/.local/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 307, in call_hook
    getattr(hook, fn_name)(self)
  File "/root/DiscoBox/mmdet/core/evaluation/eval_hooks.py", line 279, in after_train_epoch
    key_score = self.evaluate(runner, results)
  File "/root/DiscoBox/mmdet/core/evaluation/eval_hooks.py", line 177, in evaluate
    results, logger=runner.logger, **self.eval_kwargs)
  File "/root/DiscoBox/mmdet/datasets/coco.py", line 497, in evaluate
    cocoEval.evaluate()
  File "/root/.local/lib/python3.7/site-packages/pycocotools/cocoeval.py", line 149, in evaluate
    self._prepare()
  File "/root/.local/lib/python3.7/site-packages/pycocotools/cocoeval.py", line 110, in _prepare
    _toMask(gts, self.cocoGt)
  File "/root/.local/lib/python3.7/site-packages/pycocotools/cocoeval.py", line 95, in _toMask
    rle = coco.annToRLE(ann)
  File "/root/.local/lib/python3.7/site-packages/pycocotools/coco.py", line 497, in annToRLE
    rles = maskUtils.frPyObjects(segm, h, w)
  File "pycocotools/_mask.pyx", line 292, in pycocotools._mask.frPyObjects
IndexError: list index out of range
Traceback (most recent call last):
  File "/root/.local/conda/envs/py37/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/root/.local/conda/envs/py37/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/root/.local/conda/envs/py37/lib/python3.7/site-p
voidrank commented 2 years ago

Hi @DaDogs , This error happens when you evaluate DiscoBox, the format of your segmentation doesn't match the coco format

Best,

Shiyi