jiesutd / LatticeLSTM

Chinese NER using Lattice LSTM. Code for ACL 2018 paper.
1.79k stars 457 forks source link

运行demo出错 #26

Closed BaoyanWang closed 6 years ago

BaoyanWang commented 6 years ago

Epoch: 0/100 Learning rate is setted as: 0.015 Traceback (most recent call last): File "main.py", line 436, in train(data, save_model_dir, seg) File "main.py", line 281, in train loss, tag_seq = model.neg_log_likelihood_loss(gaz_list, batch_word, batch_biword, batch_wordlen, batch_char, batch_charlen, batch_charrecover, batch_label, mask) File "/root/receiveData/LatticeLSTM/model/bilstmcrf.py", line 32, in neg_log_likelihood_loss scores, tag_seq = self.crf._viterbi_decode(outs, mask) File "/root/receiveData/LatticeLSTM/model/crf.py", line 159, in _viterbi_decode partition_history = torch.cat(partition_history,0).view(seq_len, batch_size,-1).transpose(1,0).contiguous() ## (batch_size, seq_len. tag_size) RuntimeError: invalid argument 0: Tensors must have same number of dimensions: got 2 and 3 at /pytorch/torch/lib/THC/generic/THCTensorMath.cu:102

jiesutd commented 6 years ago

Please confirm you use the PyTorch 0.3.0.

wangruicn commented 6 years ago

@BaoyanWang 请参考Issue#8