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 #2

Open
zxt-triumph opened this issue Nov 13, 2020 · 2 comments
Open

RuntimeError #2

zxt-triumph opened this issue Nov 13, 2020 · 2 comments

Comments

@zxt-triumph
Copy link

When I was training the model, I had this problem:
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [256, 256, 3, 3]] 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).
How to solve this problem?
Look forward to your reply.

@ddghost
Copy link

ddghost commented Mar 2, 2021

It seems that the author has given the answer at https://github.com/nnaisense/conditional-style-transfer/blob/master/docs/issues.md

@LianShuobin
Copy link

LianShuobin commented Jun 10, 2021

Move line 194 at models/gan_aux_model.py to somewhere before line 190 will solve this issue.
Seems that the author made a mistake like this,and according to this answer,it might result in incorrect gradients.

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