Generating Metrics after loading an exported file

I am trying out Text Classification using Transfer Learning of NLP.

I have been able to train both the Language Model and Classifier and have exported the trained model using learn.export().

Now, I am trying to perform Metric Evaluation after importing this model i am getting following error -

learn = load_learner('/content/drive/My Drive/Projects/AnalyticsHackathon', 'learned_classifer_14112019.pkl')

IndexError                                Traceback (most recent call last)
<ipython-input-9-d0be1d9a8327> in <module>()
----> 1 learn.get_preds()

11 frames
/usr/local/lib/python3.6/dist-packages/fastai/text/ in __iter__(self)
103     def __len__(self) -> int: return len(self.data_source)
104     def __iter__(self):
--> 105         return iter(sorted(range_of(self.data_source), key=self.key, reverse=True))
107 class SortishSampler(Sampler):

IndexError: list index out of range

I am not able to understand why am I getting this error. Can someone help me out with this?

+1 any help is greatly appreciated.

Exported models have no data and you never load any new dataloaders in so you’re trying to do get_preds on nothing.

So, in that case, is there any way to accomplish this?

You can generate a dataloader (test set) before or during your call to load learner or do learn.predict().

See some of the documentation here: