RuntimeError: Trying to backward through the graph a second time, but the buffers have already been freed。
lfgogogo opened this issue · 1 comments
lfgogogo commented
I search the error in the title,it happens when there are several losses.But in my code,there is only the RNN-t-loss,but it gives the error.
The full sentence is ''RuntimeError: Trying to backward through the graph a second time, but the buffers have already been freed. Specify retain_graph=True when calling backward the first time.".
I tried the "retain_graph=True" parameter in loss.backward(),it failed.
So do you have some ideas about the error?
1ytic commented
Take a look at this example https://github.com/1ytic/open_stt_e2e/blob/master/train_rnnt.py