649453932 / Chinese-Text-Classification-Pytorch

中文文本分类,TextCNN,TextRNN,FastText,TextRCNN,BiLSTM_Attention,DPCNN,Transformer,基于pytorch,开箱即用。
MIT License
5.25k stars 1.22k forks source link

TypeError: an integer is required (got type NoneType) #65

Closed wander635 closed 3 years ago

wander635 commented 3 years ago

Traceback (most recent call last): File "run.py", line 52, in train(config, model, train_iter, dev_iter, test_iter) File "D:\TEMPP\Chinese-Text-Classification-Pytorch\train_eval.py", line 44, in train
for i, (trains, labels) in enumerate(train_iter): File "D:\TEMPP\Chinese-Text-Classification-Pytorch\utils.py", line 103, in next
batches = self._to_tensor(batches) File "D:\TEMPP\Chinese-Text-Classification-Pytorch\utils.py", line 83, in _totensor
x = torch.LongTensor([
[0] for _ in datas]).to(self.device) TypeError: an integer is required (got type NoneType)

没太明白为什么接受的不是整数,希望可以得到各位的指点,万分感谢。