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

About code error #9

Open
haolin512900 opened this issue Dec 25, 2020 · 4 comments
Open

About code error #9

haolin512900 opened this issue Dec 25, 2020 · 4 comments

Comments

@haolin512900
Copy link

Hi Thank your great project!
The code works up to PyTorch 1.4.There seems to be an problem with PyTorch 1.6. the description as followed:RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation:[torch.cuda.FloatTensor [1, 1024, 4, 4]] is at version 2; 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).
Can you update the code for PyTorch 1.5 or 1.6?😂

@543877815
Copy link

I meet this problem too...

@543877815
Copy link

@haolin512900 Have you solved this error??

@wsfwsf
Copy link

wsfwsf commented Mar 21, 2022

replace "G_loss.backward()"
whith "loss1 = G_loss.detach_().requires_grad_(True)
loss1.backward()"

@haolin512900
Copy link
Author

haolin512900 commented Mar 23, 2022 via email

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

3 participants