For me it was BCEWithLogitsLoss and not BCE and then all the other instructions which like"
" For this the targets should have the same shape as the model output and be FloatTensors. To get the predicted label you can apply torch.sigmoid and use a threshold via preds = output > threshold"
Thanks anyway.