@mrfabulous1 I found them to be easy. Yes I don’t have money/credit card so I wasn’t able to use Render. I have added the details on my GitHub Read me Doc. I’ll still add the details here :
- I used the starter code for deploying fast.ai on Render. For that repository and use that template to create your own repository like I created for my Pokemon Classifier.
- We need to add a Procfile to the repository and put
web: python app/server.py serve
in it. - We need to add a runtime.txt file to specify
python
version. You can use my repository for your reference. - Use the export.pkl file you generated and upload it on Google Drive and get a shareable link(Anyone can view and not restricted) and use this link generator to get the link and add it under
export_file_url
. You also need to changeclasses = ['black', 'grizzly', 'teddys']
toclasses = ['bulbasaur', 'charmander', 'pikachu']
as in my case. You need to change according to your classes. In theserver.py
file we need to add
import os
import requests
Port = int(os.environ.get('PORT', 50000))
export_file_url = 'https://drive.google.com/uc?export=download&id=1ntlwwv3Ao3kLJ_VaXgI6Gx3_01HG1Zbz'
export_file_name = 'export.pkl'
- Replace uvicorn.run
uvicorn.run(app=app, host='0.0.0.0', port=5000, log_level="info")
by
uvicorn.run(app=app, host='0.0.0.0', port=Port, log_level="info")
- Change the
index.html
file as it having the bear app details. Update it according to your need. This will represent what will show to the user when they open your application. - Once your GitHub repository is ready. Create an account on Heroku.
- Create a new app. Give a name. Connect your GitHub repository. Choose Automatic Deploy. And then Manual Deploy.
P.S. - I made my own dataset using the process described in Lesson 2. I tried this on Kaggle datasets, it doesn’t work on them. Apparently, according to application logs ‘/kaggle’ is read only and hence there was an error although my build had succeeded. As I am new to all this I don’t know the workaround. I thought, I’ll try it on a non kaggle(my own dataset) and it worked.
Reach out to me in case of any queries.
Best,
Sachin Chaturvedi