Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception has occurred: TypeError object of type 'NoneType' has no len() in learner_cls.py when do Model inference #321

Open
ruianlc opened this issue Mar 13, 2024 · 0 comments

Comments

@ruianlc
Copy link

ruianlc commented Mar 13, 2024

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant