Custom dataset runtime error
See original GitHub issueHello
I am trying to retrain yolact on Pascal Part a variation of Pascal VOC where each classes has many sub-classes. To simplify everything I make every sub-classes a class in addition with the 20 original one which give me a set 316 classes. I generated three JSON files for each case.
When I start training I encouter the following error:
RuntimeError: cannot perform reduction function max on tensor with no elements because the operation does not have an identity
Which happen here:
losses = criterion(out, wrapper, wrapper.make_mask())
train.py around line 262 (I had some print in my file so my line number is different)
Here: https://github.com/eriklindernoren/PyTorch-YOLOv3/issues/110
I read it might be a path issue however I rechecked the image path are correct. Also I am able to train Pascal Voc using the same image path without issues.
I try to investigate the forward
method of the loss function looking for an empty tensor but I did not find any.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (5 by maintainers)
Top GitHub Comments
Well there’s your problem. “iscrowd” tells COCO to ignore every detection that overlaps with it. It’s not used for training, it’s used to give the model a break when there’s a crowd of people and each person isn’t individually annotated.
Do not use iscrowd for data you actually want to train on. Like every other method and like COCO does in evaluation, I completely ignore all detections that overlap with an “iscrowd” GT.
@JSharp4273 Hi Julien, I have a similar problem. All of my images have many overlapping instances… so iscrowd=1 in the coco.json file. How can I train YOLACT with this data? I am able to train MaskRCNN with it but I would rather use YOLACT.
Regards, Sam @dbolya
EDIT: The solution was just find and replace all iscrowd: 1 to iscrowd: 0. I’m using the RLE format (not polygon). I also used waspinators function to generate the coco.json file.