youngLBW / HRN

[CVPR2023] A Hierarchical Representation Network for Accurate and Detailed Face Reconstruction from In-The-Wild Images.
https://younglbw.github.io/HRN-homepage/
Apache License 2.0
414 stars 38 forks source link

when i run multi-view get error but single no problem #5

Closed 1406428260 closed 1 year ago

1406428260 commented 1 year ago

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

youngLBW commented 1 year ago

Hi, which version of pytorch are you using?

fabricecarles commented 1 year ago

Same error here, In my case the solution was to install pytorch==1.6.0 in a python 3.8 conda environment that allow after to follow pytorch3d install https://github.com/facebookresearch/pytorch3d/blob/main/INSTALL.md

@youngLBW maybe you can update readme with

youngLBW commented 1 year ago

Same error here, In my case the solution was to install pytorch==1.6.0 in a python 3.8 conda environment that allow after to follow pytorch3d install https://github.com/facebookresearch/pytorch3d/blob/main/INSTALL.md

@youngLBW maybe you can update readme with

  • Python >= 3.8
  • PyTorch == 1.6

Thanks for your sharing! The readme has been updated.

Bys35271 commented 1 year ago

I also met this problem, the code that raise the error is "loss_all.backward()" in def forward_mvhrn(). I still can not solve it well. Following is my package version. Is this problem caused by version? Python 3.10 Pytorch 1.11.0

youngLBW commented 1 year ago

I re-implemented this error, and fix it by adding .clone() to https://github.com/youngLBW/HRN/blob/main/models/losses.py#L201, the code has been updated.