原文:报错RuntimeError: Trying to backward through the graph a second time, but the saved intermediate results have already been freed

训练GAN net时经常遇到这个问题 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 or aut ...

2021-06-09 11:47 0 7014 推荐指数:

查看详情

pytorch中反向传播的loss.backward(retain_graph=True)报错

RNN和LSTM模型中的反向传播方法,在loss.backward()处的问题, 更新完pytorch版本后容易出现问题。 问题1.使用loss.backward()报错 Trying to backward through the graph a second time ...

Tue Nov 02 02:18:00 CST 2021 0 16164
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM