PixMatch:怎么加上maxsquare loss

怎么加上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()


版权声明:本文为stdleohao原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。