Traceback (most recent call last):


 "train_direct_reconstruction.py", line 221, in <module>

run()


 "train_direct_reconstruction.py", line 187, in run

train(epoch, train_loader, generator, criterion, optimizer, opt)


 "train_direct_reconstruction.py", line 70, in train

loss.backward()


 "/disk/ocean/yichao-liang/miniconda3/envs/shape2prog/lib/python3.7/site-packages/torch/tensor.py", line 198, in backward

torch.autograd.backward(self, gradient, retain_graph, create_graph)


 "/disk/ocean/yichao-liang/miniconda3/envs/shape2prog/lib/python3.7/site-packages/torch/autograd/__init__.py", line 100, 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 [10, 3]], which is output 0 of SliceBackward, is at version 18; expected version 16 instead. Hint: the backtrace further above shows the operation that failed to compute its gradient. The variable in question was changed in there or anywhere later. Good luck!

Traceback (most recent call last):


 "train_wc.py", line 212, in <module>

dev_f1, dev_pre, dev_rec, dev_acc = evaluator.calc_score(ner_model, dev_dataset_loader)


 "/Users/shaun/Desktop/UniMelb/Semester_Unimelb/Semester3/Project/LM-LSTM-CRF/model/evaluator.py", line 209, in calc_score

decoded = self.decoder.decode(scores.data, mask_v.data)


 "/Users/shaun/Desktop/UniMelb/Semester_Unimelb/Semester3/Project/LM-LSTM-CRF/model/crf.py", line 379, in decode

decode_idx[idx] = pointer
RuntimeError: expand(torch.LongTensor{[50, 1]}, size=[50]): the number of sizes provided (1) must be greater or equal to the number of dimensions in the tensor (2)
