This short post will walk you through all of the steps necessary to deploy your app
Build Model and app notebook
Once it is model is trained and notebook is ready, create a duplicate of your working notebook with minimal content. Here is sample notebook from my work (Find My Food app) of what it should look like
Once done, download export.pkl & the minimal version of your notebook created in step 1 above
Create a repository in Github by clicking here
Note: Repository Name can be âFindBearâ, Type can be âPublicâ and you can check âInitialize this repository with a READMEâ option. Finally, click on Create repository button to create it
Upload your model (export.pkl), notebook to this repository. Additionally, you also need requirements.txt file, which you can download from here. You do not need to modify requirements.txt. Use as-is.
Note: If your model (export.pkl) is larger than 25 MBs (which is very possible, even with Resnet18, you need to use Git Large File Storage service. Steps for same are given at the end of this post
You only need 3 files (+1 README.md) to build this app. Same are highlighted below
It also includes some additional links to things you need to run your app on binder.
I tested it out on Paperspace Gradient (and to a lesser extent, Colab) but if you encounter errors, feel free to reply in this thread so I can update it.
I can second after working for multiple days with people from Binder, Microsoft, the people on this forum, and looking through the Voila documentation, Binder does not seem to render voila at all, however has no problem with jupyter notebooks as is. Heroku seems to be fine at the moment.
Hey Adi. In the requirements file you used fastai==1.0.6 but as I see you use fastai v2 in your notebook. Try to change fastai requirement to v2 and see if it helps. Also the latest version of fastai requires pytorch 1.7, so to use it you need to change the first two lines in the requirements.txt too
I tried running my notebook with the pinned versions that are compatible with heroku. Unfortunately fastai.vision.widgets throws a module not found error with the older version of fastai.
I think you are right. I tried using the pinned versions of fastai, fastcore, torch, torchvision which I trained the model and had installed in the stripped down version of the notebook.