I am trying to train a fully convolutional net from scratch for a semantic segmentation task, but the training set I have is sparse, meaning that I have to ignore pixels that do not contain information (label=0) while training.
Otherwise, I have 5 classes I am interested to retrieve.
To achieve that, I just added the argument ignore_index to the cross entropy loss function to drop the 0-labeled pixels.
However, I am confused because I would expect the net to output 5 scores (for the 5 classes of interest), although it also gives me a score for the class 0.
Does anyone have any ideas on why I get 6 class scores, expecting only 5 ?
Hey, I was facing a similar issue but I am not sure why it is working here (there are total 19 classes in cityscape dataset with one ignore label, since with ignore label there will be 20 classes, the model they should create must have 20 classes but it is not the case, they are using only 19 classes. When I try to do similar thing(although with a different pipeline), the assertion error of class comes). Please check this out, thanks in advance.