uhauha2929/examples

问题描述:IndexError: too many indices for tensor of dimension 1

JohnyWang97 opened this issue · 0 comments

您好,我试着用别的数据集跑了下textual entailment部分的代码,与SNLI对比数据集的格式是一致,在最后一步运行train()的时候报错_IndexError: too many indices for tensor of dimension 1_,我不太清楚是哪里处理问题,另外在运行这行代码iter(train_iter).__next__()时我的输出与与您不太一样,结果如下:
[torchtext.data.batch.Batch of size 256]
[.premise]:[torch.cuda.LongTensor of size 44x256 (GPU 0)]
[.hypothesis]:[torch.cuda.LongTensor of size 25x256 (GPU 0)]
[.label]:[torch.cuda.LongTensor of size 256 (GPU 0)]
请问是否是这一步出现了问题呢,十分感谢您的帮助,谢谢!