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: one of the variables needed for gradient computation has been modified by an inplace operation #3

Open
Krb686 opened this issue May 13, 2022 · 0 comments

Comments

@Krb686
Copy link

Krb686 commented May 13, 2022

Running this code with pytorch >= 1.5 gives the following error

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor            
[3, 64, 7, 7]] is at version 3; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its                
gradient, with torch.autograd.set_detect_anomaly(True).

See this issue

According to albanD the issue is the discriminator parameters being updated in place but also being needed afterwards.

The error happens here. I'm not familiar enough with GANs yet to know what to fix here.

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