I also had to unsqueeze the labels and it worked
label_true= y_true.unsqueeze(1)
It is now running and the performance is very poor.
Please, would it be necessary to perform some processing operations such as normalization, data augmentation,etc? By the way, the whole training data might be around 20 000 samples. The small sample set used currently is just for setting up a demo.
Any suggestions would be highly appreciated given my shortages  in programming and segmentation tasks