python - UNET with CrossEntropy Loss Function - Stack Overflow
https://stackoverflow.com/.../unet-with-crossentropy-loss-function29.04.2021 · Now I send my images to the model and the dimension of the predicted masks are [2,128,128]. Now to train a model I choose 16 as batch size. So, now I have input as [16,3,128,128] so the predicted dimension is [16,2,128,128]. But I have ground-truth masks as [16,1,128,128]. Now how can I apply Cross entropy loss in Pytorch?