loss = nn.BCEWithLogitsLoss(masks_pred,true_masks)
于是就报错上面的错 RuntimeError: Boolean value of Tensor with more than one value is ambiguous
原因格式写错了
解决方案
loss = nn.BCELoss()(masks_pred,true_masks)
loss = nn.BCEWithLogitsLoss(masks_pred,true_masks)
于是就报错上面的错 RuntimeError: Boolean value of Tensor with more than one value is ambiguous
原因格式写错了
解决方案
loss = nn.BCELoss()(masks_pred,true_masks)