BCELoss RuntimeError: Boolean value of Tensor with more than one value is ambiguous

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)

你可能感兴趣的:(深度学习,神经网络,人工智能)