You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
predict()
TypeError: object of type 'NoneType' has no len()
The text was updated successfully, but these errors were encountered:
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?
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
predict()
TypeError: object of type 'NoneType' has no len()
The text was updated successfully, but these errors were encountered: