when i use nn.CrossEntropyLoss to train a segmentation model.But it shows that 'lonly batches of spatial targets supported(non-empty 3D tensors)but got targets of size :[2,1,512,512]
the output_size of the model is [2,2,512,512](batch_size = 2 and num_classes = 2]
Thanks