InterGCN-ABSA
InterGCN-ABSA copied to clipboard
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation
Error occurs when performing the code below according to README.md's method
CUDA_VISIBLE_DEVICES=1 python3 train.py --model_name intergcn --dataset rest14 --save True --learning_rate 1e-3 --seed 29 --batch_size 16
But when i runing it got this error:
Traceback (most recent call last):
File "train.py", line 215, in <module>
ins.run()
File "train.py", line 144, in run
max_test_acc, max_test_f1 = self._train(criterion, optimizer)
File "train.py", line 78, in _train
loss.backward()
File "/home/dahye/venv_intergcn/lib/python3.6/site-packages/torch/tensor.py", line 102, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/dahye/venv_intergcn/lib/python3.6/site-packages/torch/autograd/__init__.py", line 90, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation
Please help..
I'm very sorry. Have you ever tried to change the version of Pytorch to 1.0.0?
Already pytorch version is 1.0.0. This is my environment.
Python 3.6.9
Pytorch 1.0.0
Spacy 2.0.18
Numpy 1.15.4
I have the same problem...
Already pytorch version is 1.0.0. This is my environment.
Python 3.6.9 Pytorch 1.0.0 Spacy 2.0.18 Numpy 1.15.4
I'm very sorry. Since I won't meet this error when I run the code. Could you please tell me when did you meet this error?
I have the same problem...
I'm very sorry. Since I won't meet this error when I run the code. Could you please tell me when did you meet this error?
just change x += 0.2 * x_d to x = x + 0.2 * x_d In the model forward propagation code.this works for me
nice , this works for me too