1ytic / warp-rnnt

CUDA-Warp RNN-Transducer
MIT License
211 stars 41 forks source link

RuntimeError: Trying to backward through the graph a second time, but the buffers have already been freed。 #12

Open lfgogogo opened 3 years ago

lfgogogo commented 3 years ago

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 3 years ago

Take a look at this example https://github.com/1ytic/open_stt_e2e/blob/master/train_rnnt.py