Hello, I’m trying to implement a segmentation model using the VOC 2012 data, and I was having trouble with calculating the loss.
I am using cross entropy loss, but then I get the error
RuntimeError: Assertion `cur_target >= 0 && cur_target < n_classes' failed.  at ..\aten\src\THNN/generic/ClassNLLCriterion.c:92

when I try to set the number of classes to 22 for the output. This is because the data has a label of 255 for void, and thus pytorch thinks there are 256 classes. I was wondering how to rectify this? I loaded the data using torchvision.datasets.VOCSegmentation. Another thing I was not clear about was do people actually try to label the void pixels in practice? Thanks so much