asiddhant / Active-NLP

Bayesian Deep Active Learning for Natural Language Processing Tasks
147 stars 29 forks source link

builtins.RuntimeError: dimension out of range (expected to be in range of [-1, 0], but got 1) #2

Closed aopusd closed 6 years ago

aopusd commented 6 years ago

this line have error ,how to fix it, thanks! packed_rnn_input = torch.nn.utils.rnn.pack_padded_sequence(rnn_input, input_lengths,batch_first=False)

builtins.RuntimeError: dimension out of range (expected to be in range of [-1, 0], but got 1) decoder_output, last_hidden, decoder_attention = decoder(di,decoder_input, last_hidden, encoder_outputs,input_lengths=lengths_sorted) File "D:\ProgramData\Anaconda3\Lib\site-packages\torch\nn\modules\module.py", line 491, in call result = self.forward(*input, *kwargs)  File "D:\change\chunking\models\seq2seq\scripts\model.py", line 205, in forward packed_rnn_input = torch.nn.utils.rnn.pack_padded_sequence(rnn_input, input_lengths,batch_first=False) File "D:\ProgramData\Anaconda3\Lib\site-packages\torch\onnx__init__.py", line 57, in wrapper return fn(args, *kwargs) File "D:\ProgramData\Anaconda3\Lib\site-packages\torch\nn\utils\rnn.py", line 124, in pack_padded_sequence data, batch_sizes = PackPadded.apply(input, lengths, batch_first) File "D:\ProgramData\Anaconda3\Lib\site-packages\torch\nn_functions\packing.py", line 31, in forward steps.append(input[prev_l:l, :c_batch_size].contiguous().view(-1, input.size()[2:]))

builtins.RuntimeError: dimension out of range (expected to be in range of [-1, 0], but got 1)

asiddhant commented 6 years ago

Which command is causing this error ? dataset ? method ?

asiddhant commented 6 years ago

closing this for now. Let me know which specific case is causing this error and I ll get back to you.