Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LLL-YUE opened this issue Feb 28, 2023 · 0 comments

Comments

@LLL-YUE
Copy link

LLL-YUE commented Feb 28, 2023

While running one_hot.backward(retain_graph=True) , an error appears.
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.
But retain_graph=True is already in backward()
How can I deal with this situation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant