Closed liuhaifeng0212 closed 2 years ago
Good question. I clone the repository and try to install it in a new environment. Then, I also get the same issue and am not sure how to fix it. Maybe the dnc package is updated. Please refer to the original DMNC repo: https://github.com/thaihungle/DMNC
Dear author, the DMNC source code has reported the following error, do you have any solutions?
Traceback (most recent call last): File "SafeDrug/src/DMNC.py", line 187, in
main()
File "SafeDrug/src/DMNC.py", line 154, in main
loss.backward(retain_graph=True)
File "D:\liuhaifeng\anaconda\envs\bibi\lib\site-packages\torch\tensor.py", line 185, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "D:\liuhaifeng\anaconda\envs\bibi\lib\site-packages\torch\autograd__init__.py", line 127, 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 [128, 136]], which is output 0 of TBackward, 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).