一个正确的语义分割二分类损失函数的计算应该是如下这样的
criterion = nn.BCEWithLogitsLoss(weight=None)
masks_pred = net(imgs)
loss = criterion(masks_pred, true_masks) #使用二分类交叉熵
epoch_loss += loss.item()
先前在网络最后输出时使用sigmoid,然后使用BCELoss,也是正确的ÿ
一个正确的语义分割二分类损失函数的计算应该是如下这样的
criterion = nn.BCEWithLogitsLoss(weight=None)
masks_pred = net(imgs)
loss = criterion(masks_pred, true_masks) #使用二分类交叉熵
epoch_loss += loss.item()
先前在网络最后输出时使用sigmoid,然后使用BCELoss,也是正确的ÿ