Bert-Chinese-Text-Classification-Pytorch icon indicating copy to clipboard operation
Bert-Chinese-Text-Classification-Pytorch copied to clipboard

DatasetIterater函数中有bug

Open chenglong19920630 opened this issue 2 years ago • 2 comments

3个数据集合其中dev或者train数据量和batch_size能整除的时候就回出现问题,DatasetIterater函数这块一个bug,会导致爆出问题 IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)

image

chenglong19920630 avatar Mar 01 '22 06:03 chenglong19920630

image elif self.index > self.n_batches: 修改为 elif self.index >= self.n_batches: 应该就可以了

chenglong19920630 avatar Mar 01 '22 15:03 chenglong19920630

我也遇到了这个错误,修改为>=还是会出现这个错误

badmic avatar Apr 20 '24 13:04 badmic