question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KeyError: 'segmentation'

See original GitHub issue

For cascade_rcnn_r50_fpn_1x.py and custom dataset for detection only I’ve got

File "/learning/other/mmdetection/mmdet/datasets/coco.py", line 87, in _parse_ann_info
gt_masks_ann.append(ann['segmentation'])
KeyError: 'segmentation' 

And after changing train_pipeline options: dict(type='LoadAnnotations', with_bbox=True, with_mask=False),

This error still exist. I assume for COCO it works, because COCO has masks. But for detection dataset it doesn’t work.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
vadik6666commented, Aug 29, 2019

Solved after changing my annotation file which looked like for some bbox:

{'area': 702.1057499999998,
 'iscrowd': 0,
 'image_id': 289343,
 'bbox': [473.07, 395.93, 38.65, 28.67],
 'category_id': 18,
 'id': 1768}

and added new key-value like 'segmentation': []

0reactions
naveenggmucommented, May 21, 2020

@Aavesh is there a way to train models like retinaNet without providing masks? Also can you please tell where to find “config.py” that you have mentioned above. @David-19940718 @CMobley7

Read more comments on GitHub >

github_iconTop Results From Across the Web

detectron2 training keyerror - python - Stack Overflow
I am trying to train my own COCO dataset with detectron2, however when I start my own training I encounter a key error....
Read more >
Getting KeyError: 'id' even when 'id' is present in the json file
Context: I am trying to train the VOC dataset on this few shot object detection library called FewX and in order to do...
Read more >
mmdet.datasets.coco_panoptic - MMDetection's documentation!
... """Coco dataset for Panoptic segmentation. ... if metric not in allowed_metrics: raise KeyError(f'metric {metric} is not supported') result_files, ...
Read more >
KeyError in opening omeTiff - Usage & Issues - Image.sc Forum
D:\20913\Anaconda3\envs\segmentation\lib\site-packages\aicsimageio\aics_image.py in init(self, image, reader, reconstruct_mosaic, **kwargs)
Read more >
Installation of ITKElastix with pip - Beginner Questions - ITK
... 5.3rc4 itk-registration 5.3rc4 itk-segmentation 5.3rc4 itk-strain ... itk_base_global_module_data[name] KeyError: 'ITKImageSources'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found