原文:報錯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