Dear sir,
My sincere apologies. I have crosschecked everything and you are right. I have been on this bug for almost two days now.
target size = [4,128,128,128]
outputs size = [4,2,128,128,128]
With this loss function, how should I apply the threshold to the model output?
            outputs = net(volume_batch)
            
            loss_seg= F.cross_entropy(outputs,label_batch.long())
            outputs_soft= F.softmax(outputs,dim=1)
            loss_seg_dice = dice_loss(outputs_soft[:,1,:,:,:],label_batch == 1)
            loss= loss_seg + loss_seg_dice

My sincere gratitude for your time, patience and kindness