fastai learner requirements and batch prediction

In fastai, you can now export and load a learner to do prediction on the test set without having to load a non empty training and validation set. To do that, you should use export method and load_learner function (both are defined in basic_train).

In your current situation, you might have to load your learner the old way (with a train/valid dataset), then export it and you'll be able to use load_learner to do your predictions on your test set.

I'll leave a link to the documentation :

-https://docs.fast.ai/basic_train.html#Deploying-your-model

This should clarify any follow up questions.


data = ImageClassifierData.from_paths(PATH, tfms=tfms, bs=64)
learn = ConvLearner.pretrained(arch, data, precompute=False)
learn.unfreeze()
learn.load('224_all')

preds = learn.predict(is_test=True)