znxlwm / pytorch-generative-model-collections

Collection of generative models in Pytorch version.
2.59k stars 546 forks source link

InfoGAN can not run because of the pytorch version problem #34

Open Sun-Happy-YKX opened 2 years ago

Sun-Happy-YKX commented 2 years ago

/home/yangkaixing/miniconda3/envs/GASDA/lib/python3.6/site-packages/torch/nn/functional.py:1806: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead. warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.") Traceback (most recent call last): File "main.py", line 112, in main() File "main.py", line 104, in main gan.train() File "/data/yangkaixing/Generative_Model_Collections/infoGAN.py", line 230, in train info_loss.backward() File "/home/yangkaixing/miniconda3/envs/GASDA/lib/python3.6/site-packages/torch/_tensor.py", line 307, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs) File "/home/yangkaixing/miniconda3/envs/GASDA/lib/python3.6/site-packages/torch/autograd/init.py", line 156, in backward allow_unreachable=True, accumulate_grad=True) # allow_unreachable flag RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [64, 3, 4, 4]] 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).

gnlup commented 5 months ago

Have you solved it yet? I have come across the same question.