AssertionError when training panoptic segmentation head
See original GitHub issueHi, thanks again for the work put into this project!
I have trained a object detection model on a custom dataset and now want to train the segmentation head, however I get the following error after a few batches of training:
File "/home/daniel/Work/detr/util/box_ops.py", line 53, in generalized_box_iou
assert (boxes2[:, 2:] >= boxes2[:, :2]).all()
AssertionError
Full traceback
Traceback (most recent call last):
File "main.py", line 307, in <module>
main(args)
File "main.py", line 212, in main
train_stats = train_one_epoch(
File "/home/daniel/Work/detr/engine.py", line 33, in train_one_epoch
loss_dict = criterion(outputs, targets)
File "/home/daniel/.conda/envs/pytorch/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/daniel/Work/detr/models/detr.py", line 225, in forward
indices = self.matcher(outputs_without_aux, targets)
File "/home/daniel/.conda/envs/pytorch/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/daniel/.conda/envs/pytorch/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 15, in decorate_context
return func(*args, **kwargs)
File "/home/daniel/Work/detr/models/matcher.py", line 74, in forward
cost_giou = -generalized_box_iou(box_cxcywh_to_xyxy(out_bbox), box_cxcywh_to_xyxy(tgt_bbox))
File "/home/daniel/Work/detr/util/box_ops.py", line 53, in generalized_box_iou
assert (boxes2[:, 2:] >= boxes2[:, :2]).all()
AssertionError
My dataset contains 3 classes and as such I have modified the num_classes, in argparse too. It is consistent with https://github.com/facebookresearch/detr/issues/28#issuecomment-636712413
Any idea of why I’m getting this error?
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (9 by maintainers)
Top Results From Across the Web
Tutorial 2: Customize Datasets - MMDetection's documentation!
1. Modify the config file for using the customized dataset · The data field. Specifically, you need to explicitly add the classes fields...
Read more >train.py - gagan3012/yolov5 - DagsHub
train.py ... getLogger(__name__); def train(hyp, opt, device, tb_writer=None, ... 'true'; except (ImportError, AssertionError):; logger.info("Install ...
Read more >Panoptic Segmentation: Definition, Datasets & Tutorial [2022]
Panoptic segmentation is the task of simultaneously segmenting objects and classifying them into categories. Discover different approaches to the task.
Read more >How to train Detectron2 with Custom COCO Datasets - DLology
This tutorial will help you get started with Detectron2 framework by training an instance segmentation model with your custom COCO datasets.
Read more >mmdet - PyPI
Faster training and testing speed with complete support of mixed precision ... Object Detection, Instance Segmentation, Panoptic Segmentation, Other.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The previous error was caused by me, the
isthing
had been stored as a string.I can now train the panoptic head. Thank you very much for the help @alcinos & @fmassa!
Hi @fmassa, @DanielFennhagen, @alcinos , I am also getting exactly the same ZeroDivisionError and was curious how did you solve this? I made the change outlined above #244 but still getting the error (probably unrelated to the fix). I checked the isthing value and type by using print statements, in my json files my isthing has the value of 1 as an integer for my custom datatset.