How did you create the target?
If you are using nn.CrossEntropyLoss as your criterion, your target should be a LongTensor, have the shape [batch_size, height, width], and contain the class indices in the range [0, nb_classes-1].