Many thanks for your reply. I am sure it’s some detail i just dont understand.
Alternatively, I did try this the way you say i.e (using the softmax on my output(Shape - [32, 2, 256,256])) followed by the Cross Entropy loss and doing squeeze(1) on my target(Shape - [32, 256, 256])
It works but it doesn’t learn anything, the first output of the segmentation mask before training is already good since i use a transfer learning pretrained model however, after running first iteration and calculating loss, the output has nothing besides the training loss goes down for a few batches and plateaus.
I am quite certain my loss and shapes are just not right, it’ll be awesome if you could help out. I wasted a bright sunny day getting nowehere.