欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

torch.nn.BCELoss are unsafe to autocast

程序员文章站 2024-03-25 10:54:16
...

torch.nn.BCELoss are unsafe to autocast

默认初始loss:

lobj = torch.zeros(1, device=device)

临时解决方法:

bce_loss = nn.BCEWithLogitsLoss(reduction="sum").to(device)

BCEWithLogitsLoss 预测不需要家sigmoid,标签

相关标签: pytorch知识宝典