Error in Inference using ULMfit text classification


(Rupesh Goud) #1

I’m trying to do inference using the model I trained,
I’m getting an error TypeError: object of type ‘NoneType’ has no len() when calling text_classifier_learner,

empty_data = TextClasDataBunch.load_empty(datadump)
learn = text_classifier_learner(empty_data)
learn.load('classifier_learn_cl', with_opt=False);

My empty data looks like below,

TextClasDataBunch;

Train: LabelList
y: MultiCategoryList (0 items)
[]...
Path: ../datadump
x: TextList (0 items)
[]...
Path: ../datadump;

Valid: LabelList
y: MultiCategoryList (0 items)
[]...
Path: ../datadump
x: TextList (0 items)
[]...
Path: ../datadump;

Test: None

And there is export.pkl at datadump that equals to PosixPath('../datadump')

Please help, what I am missing here??
Thanks in advance


Making predictions in v1
Multilabel classification with ULMFiT in Fastai v1