wangguanzhi / LADN

This is the implementation for Local Adversarial Disentangling Network for Facial Makeup and De-Makeup
https://georgegu1997.github.io/LADN-project-page/
181 stars 26 forks source link

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

Open mmammoth opened 1 year ago

mmammoth commented 1 year ago

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 commented 1 year ago

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