yuzhimanhua/Multi-BioNER

RuntimeError: expand(torch.cuda.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)

asifkhan2017 opened this issue · 1 comments

I am getting this error

Traceback (most recent call last):
File "train_wc.py", line 288, in
dev_f1, dev_pre, dev_rec, dev_acc = evaluator.calc_score(ner_model, dev_dataset_loader[file_no], file_no)
File "F:\Projects\Python\NLP\Multi-BioNER-master\model\evaluator.py", line 210, in calc_score
decoded = self.decoder.decode(scores.data, mask_v.data)
File "F:\Projects\Python\NLP\Multi-BioNER-master\model\crf.py", line 387, in decode
decode_idx[idx] = pointer
RuntimeError: expand(torch.cuda.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)

The issue was in torch version. Lm_lstm_crf only works with pytorch 0.2 or 0.3 version.