uhauha2929 / examples

132 stars 62 forks source link

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

Open JohnyWang97 opened 4 years ago

JohnyWang97 commented 4 years ago

您好,我试着用别的数据集跑了下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)] 请问是否是这一步出现了问题呢,十分感谢您的帮助,谢谢!