怎么加上maxsquare loss
模仿maxsquare loss
对照着target loss 加到了PixMatch里面
加maxsquare loss的时候出现了
pytorch unsupported operand type(s) for *: 'MaxSquareloss' and 'float'
# wrong:
MaxSquareloss(pred_1, prob_1)
# right:
MaxSquareloss()(pred_1, prob_1)
函数
cpu().item() #从cuda拿到cpu,转成标量
torch.max()
torch.where()
torch.argmax()
F.softmax()
.detach()