RuntimeError: Trying to backward through the graph a second time #13219
Answered
by
josyulakrishna
josyulakrishna
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
-
Hi Everyone, I'm trying to use the torchdyn library to solve a problem of mine, code is given here, when I try to run this code I'm getting an error which says Error:
Code
|
Beta Was this translation helpful? Give feedback.
Answered by
josyulakrishna
Jun 3, 2022
Replies: 1 comment
-
This can be resolved by using
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
josyulakrishna
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This can be resolved by using
return Variable(dyn).requires_grad_(True)
,x = Variable(x.data, requires_grad=True)