I am trying to implement a fully convolutional network for semantic segmentation on the Pascal VOC dataset.
I am using the NLL Loss 2D but this throws up an error since it requires the target to be a long tensor but I have image targets.
How to circumvent this ? Is there any other loss function that I can make use of ?
TypeError: FloatSpatialClassNLLCriterion_updateOutput received an invalid combination of arguments - got (int, torch.FloatTensor, torch.FloatTensor, torch.FloatTensor, bool, NoneType, torch.FloatTensor, int), but expected (int state, torch.FloatTensor input, torch.LongTensor target, torch.FloatTensor output, bool sizeAverage, [torch.FloatTensor weights or None], torch.FloatTensor total_weight, int ignore_index)