摘要:
原因是之前给代码debug的时候加上了with torch.autograd.detect_anomaly,去掉即可。参考:https://github.com/pytorch/pytorch/issues/38714 阅读全文
posted @ 2023-10-13 18:38
脂环
阅读(20)
评论(0)
推荐(0)
摘要:
原因是把创建loss的语句loss_aux = torch.tensor(0.)放在循环体外了,可能的解释是第一次backward后把计算图删除,第二次backward就会找不到父节点,也就无法反向传播。参考:https://stackoverflow.com/questions/55268726/ 阅读全文
posted @ 2023-10-13 18:23
脂环
阅读(469)
评论(0)
推荐(0)

浙公网安备 33010602011771号