Closed umyta closed 4 years ago
I did not run into it before. You may try to degrade your pytorch version.
The code was verified on pytorch0.4.1 and pytorch1.1
OK, let me try that. Thanks.
OK, let me try that. Thanks.
Have you solved it now? I have the same problem
OK, let me try that. Thanks.
i used pytorch1.1 ,But the same error occurred
@XiaohangZhan pytorch1.1 is working for me. Thanks!
@zhenghan408 , I used python3.7
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=10.0 -c pytorch
.
I have solve this problem according to this link: https://discuss.pytorch.org/t/solved-pytorch1-5-runtimeerror-one-of-the-variables-needed-for-gradient-computation-has-been-modified-by-an-inplace-operation/90256.
What you need to do is modify models/partial_completion_content_cgan.py
line 145-154. Please Rearrange it as:
# update
self.optimD.zero_grad()
self.optim.zero_grad()
dis_loss.backward()
gen_loss.backward()
utils.average_gradients(self.netD)
utils.average_gradients(self.model)
self.optimD.step()
self.optim.step()
Thanks, could you please check if the training outputs keep similar before and after modification, and the performance does not hurt? If so, I will modify the code accordingly.
Hi, could you give me some advice on this error. The details of the experiment is listed as follows:
I followed the instructions to run training. PCNet-M trains fine, and I did convert the partialconv.pth model to accept 4 channel inputs. When I run "sh experiments/COCOA/pcnet_c/train.sh", I got the following error:
Has anyone run into this error before? Any help would be much appreciated. Thanks!