unexpected error in pytorch backward
在写模型训练的时候遇到奇怪的报错:
1 | RuntimeError: Trying to backward through the graph a second time, but the saved intermediate results have already been freed. Specify retain_graph=True when calling backward the first time. |
在写模型训练的时候遇到奇怪的报错:
1 | RuntimeError: Trying to backward through the graph a second time, but the saved intermediate results have already been freed. Specify retain_graph=True when calling backward the first time. |
记录一次模型推理过程中显存不断增加直至Out-of-Memory的解决过程.