After print(target.min(), target.max())
,I got target.min() == 0 rather than -1 I expected. I set the label pixel value to -1 follow your advice here Got RuntimeError: Boolean value of Tensor with more than one value is ambiguous during training - #2 by ptrblck , but it seemed this did not work as I expected? Could you please give me any clues? Many thanks.