LiyuanLucasLiu / LM-LSTM-CRF

Empower Sequence Labeling with Task-Aware Language Model
http://arxiv.org/abs/1709.04109
Apache License 2.0
846 stars 207 forks source link

RuntimeError: expand(torch.LongTensor{[50, 1]}, size=[50]) #30

Closed gaoxiangyu369 closed 6 years ago

gaoxiangyu369 commented 6 years ago

After running the first epoch(successfully), I got the following error message and the program got interrupted:

/Users/shaun/anaconda3/lib/python3.6/site-packages/torch/nn/modules/rnn.py:38: UserWarning: dropout option adds dropout after all but last recurrent layer, so non-zero dropout expects num_layers greater than 1, but got dropout=0.55 and num_layers=1 "num_layers={}".format(dropout, num_layers)) /Users/shaun/Desktop/UniMelb/SemesterUnimelb/Semester3/Project/LM-LSTM-CRF/model/utils.py:805: UserWarning: nn.init.uniform is now deprecated in favor of nn.init.uniform. nn.init.uniform(input_linear.weight, -bias, bias) /Users/shaun/Desktop/UniMelb/SemesterUnimelb/Semester3/Project/LM-LSTM-CRF/model/utils.py:816: UserWarning: nn.init.uniform is now deprecated in favor of nn.init.uniform. nn.init.uniform(weight, -bias, bias) /Users/shaun/Desktop/UniMelb/SemesterUnimelb/Semester3/Project/LM-LSTM-CRF/model/utils.py:819: UserWarning: nn.init.uniform is now deprecated in favor of nn.init.uniform. nn.init.uniform(weight, -bias, bias)

Does anyone know how to resolve this?

Best regards

LiyuanLucasLiu commented 6 years ago

it seems that you are using pytorch 0.4, while this repo only supports pytorch 0.3