Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [16, 32, 1]], which is output 0 of IndexPutBackward, 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). #52

Open
fgqile opened this issue Dec 10, 2021 · 0 comments

Comments

@fgqile
Copy link

fgqile commented Dec 10, 2021

how to solve it? i have no idea

Traceback (most recent call last):
File "./src/main.py", line 111, in
main(opt)
File "./src/main.py", line 73, in main
log_dict_train, _ = trainer.train(epoch, train_loader)
File "/data/RTM3D/src/lib/trains/base_trainer.py", line 163, in train
return self.run_epoch('train', epoch, data_loader,unlabel_loader1,unlabel_loader2,unlabel_set,iter_num,uncert)
File "/data/RTM3D/src/lib/trains/base_trainer.py", line 116, in run_epoch
loss.backward()
File "/home/user/anaconda3/envs/rtm37/lib/python3.7/site-packages/torch/tensor.py", line 118, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/user/anaconda3/envs/rtm37/lib/python3.7/site-packages/torch/autograd/init.py", line 95, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [16, 32, 1]], which is output 0 of IndexPutBackward, 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant