FlowQA icon indicating copy to clipboard operation
FlowQA copied to clipboard

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

Open susht3 opened this issue 6 years ago • 0 comments

i change the code to evaluate for n batches, and get this error:

Traceback (most recent call last): File "train_CoQA.py", line 234, in main() File "train_CoQA.py", line 122, in main model.update(batch) File "/home/susht3/workspace/flow/QA_model/model_CoQA.py", line 87, in update score_s, score_e, score_c = self.network(*inputs) File "/home/susht3/local/anaconda3/envs/susht/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(*input, **kwargs) File "/home/susht3/workspace/flow/QA_model/detail_model.py", line 163, in forward representation_with_bos_eos, mask_with_bos_eos File "/home/susht3/local/allennlp/allennlp/nn/util.py", line 1222, in remove_sentence_boundaries sequence_lengths = mask.sum(dim=1).detach().cpu().numpy() RuntimeError: Dimension out of range (expected to be in range of [-1, 0], but got 1)

susht3 avatar Dec 17 '18 05:12 susht3