Exception has occurred: TypeError object of type 'NoneType' has no len() in learner_cls.py when do Model inference
when load the local trained model, and do the model inference based on the given example, error occurs, below is the full information. anyone can helps, thanks.
Exception has occurred: TypeError
object of type 'NoneType' has no len()
File "E:\workspace\baseProject\code_repo\competitions\FastBERT-MutliLabel Text Classification\fast-bert\fast_bert\learner_cls.py", line 344, in init
t_total = len(train_dataloader) // self.grad_accumulation_steps * epochs
File "E:\workspace\baseProject\code_repo\competitions\FastBERT-MutliLabel Text Classification\fast-bert\fast_bert\learner_cls.py", line 245, in from_pretrained_model
return BertLearner(
File "E:\workspace\baseProject\code_repo\competitions\FastBERT-MutliLabel Text Classification\fast-bert\fast_bert\prediction.py", line 66, in get_learner
learner = BertLearner.from_pretrained_model(
File "E:\workspace\baseProject\code_repo\competitions\FastBERT-MutliLabel Text Classification\fast-bert\fast_bert\prediction.py", line 46, in init
self.learner = self.get_learner()
File "E:\workspace\baseProject\code_repo\competitions\FastBERT-MutliLabel Text Classification\fastbert-multilable.py", line 141, in predict
predictor = BertClassificationPredictor(
File "E:\workspace\baseProject\code_repo\competitions\FastBERT-MutliLabel Text Classification\fastbert-multilable.py", line 164, in
Hi @ruianlc I encountered the same problem after I upgraded the fast-bert package. It may be caused by upgrading this package, but I am not sure how I should change the code to aviod this issue. After so long, have you solved it?