DuaneNielsen / DeepInfomaxPytorch

Learning deep representations by mutual information estimation and maximization
https://arxiv.org/abs/1808.06670
321 stars 47 forks source link

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation #10

Closed liunanbo closed 4 years ago

liunanbo commented 4 years ago

This model works perfectly beforen However,recently update my torch and torchvision into latest version and got this error.

liunanbo commented 4 years ago

[ 1/1000]Loss/Train: 2.22276e+00: 0%| | 0/4453 [00:00<?, ?it/s]Warning: Error detected in AddmmBackward. Traceback of forward call that caused the error: File "Train.py", line 106, in E, M = encoder(data) File "/home/nliu/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, *kwargs) File "/home/nliu/DIM/Model.py", line 42, in forward E = self.l1(E.view(x.shape[0], -1)) File "/home/nliu/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(input, **kwargs) File "/home/nliu/miniconda3/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 87, in forward return F.linear(input, self.weight, self.bias) File "/home/nliu/miniconda3/lib/python3.7/site-packages/torch/nn/functional.py", line 1610, in linear ret = torch.addmm(bias, input, weight.t()) (print_stack at /pytorch/torch/csrc/autograd/python_anomaly_mode.cpp:60) [ 1/1000]Loss/Train: 2.22276e+00: 0%| | 0/4453 [00:01<?, ?it/s] Traceback (most recent call last): File "Train.py", line 119, in mi_loss.backward()