yanwii / seq2seq

基于Pytorch的中文聊天机器人 集成BeamSearch算法
Apache License 2.0
241 stars 87 forks source link

Traceback (most recent call last): File "seq2seq.py", line 441, in <module> seq.train() File "seq2seq.py", line 211, in train inputs, targets = self.next(1, shuffle=False) File "seq2seq.py", line 193, in next inputs = Variable(torch.LongTensor(inputs)).transpose(1, 0).contiguous() RuntimeError: given sequence has an invalid size of dimension 2: 0 #6

Closed skarl-api closed 7 years ago

skarl-api commented 7 years ago

这个错误是什么意思呢? Traceback (most recent call last): File "seq2seq.py", line 441, in seq.train() File "seq2seq.py", line 211, in train inputs, targets = self.next(1, shuffle=False) File "seq2seq.py", line 193, in next inputs = Variable(torch.LongTensor(inputs)).transpose(1, 0).contiguous() RuntimeError: given sequence has an invalid size of dimension 2: 0

yanwii commented 7 years ago

inputs是空的

skarl-api commented 7 years ago

@yanwii 恍然大悟