Deployment Platform: Render ✅

Due to the depreciation of the single_from_class method of DataBunch, please note that :

  • You now need to give the app the export.pkl file download link given by learner.export() rather than the .pth file given by learner.save()
  • No need to create an empty DataBunch, simply create a learner with load_learner. Here’s what the setup_learner should look like in server.py :
async def setup_learner():
    await download_file(model_file_url, path/'models'/f'{model_file_name}.pkl')
    defaults.device = torch.device('cpu')   
    learn = load_learner(path/'models', f'{model_file_name}.pkl')
    return learn

This is written mainly so that @anurag can update the github repo and the tutorial, but if others are still using the old version be careful it won’t work properly. It’s not throwing an error, but the model isn’t working as it should be.

3 Likes