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

A problem about:"RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation" #14

Open
mmammoth opened this issue Jun 6, 2023 · 1 comment

Comments

@mmammoth
Copy link

mmammoth commented Jun 6, 2023

Excuse , I have a question, when I run it, I faced a problem like this:
"RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [128]] 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).

Locate the problem in the step of loss_z_L1.backward() in model.py. I searched that some said it was an error in the process of backpropagation, and some said it was a pytorch version problem, but currently pytorch1.1.0 cannot be installed with conda.

The versions I use are pytorch1.5.1, torchvision0.6.1, cuda10.1

picture
Do you know how to solve it? Thank you so much!

@tianxiaoer
Copy link

May I ask if your problem has been resolved? I have also encountered the same problem.

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

2 participants