thejas_karkera:

“Used nn.CrossEntropyLoss(), num_classes=256(randomly initialized, bcz i was getting the len(colors) as 2992”


Since you don’t know the number of classes, I think you would have to estimate it.
Do 2992 unique colors look right for the processed dataset?



 thejas_karkera:

“ValueError: Expected target size (1, 480), got torch.Size([1, 3, 480])”


What shape does the model output have?
If you are working on a multi-class segmentation use case, the output should have the shape [batch_size, nb_classes, height, width], while the target should have the shape [batch_size, height, width] and contain class indices in the range [0, nb_classes-1].