A walk with fastai2 - Vision - Study Group and Online Lectures Megathread

Hi vahuja4 hope all is well!

If you could point me to some resources, please.

I suggest you read the following threads.

https://forums.fast.ai/t/free-web-deployment/62333m - This shows the challenges of deploying on a platform which you haven’t used before.

Deployment Platform: Render ✅ This is the thread I would recommend if your not an expert in web apps, because it uses starter code that can be found here https://course.fast.ai/deployment_render.html, it can also be set up locally, and there many posts on the render thread discussing issues.

Also in the previous link are four other options such as AWS however they all can be tricky if your not experienced in html, css, javascript, docker, web apps, server side coding etc.

I can see that there are two files called stage1.pth and stage2.pth, created in the models directory.
How do I take them and use them for inference?

I would suggest you complete the production part of the notebook and create a .pkl file for your model save this on your G drive or locally and and run (pip list or pip freeze) and save the contents to a text file as you will need to make sure the library versions of the platform you deploy on are the same versions as the platform you trained on. Save this with your .pth files though I see more deployments with .pkl files than .pth files.

Remember fastai2 is still in development so there are not many deployment resources yet.
All the resources mentioned above have worked for fastai version 1.

Many people find the deploying part way more difficult than running through the notebook and Jeremy recommends building an app as it really shows how much you have understood.

If your a web app genius you can create your own app for inference!

Cheers mrfabulous1 :smiley: :smiley:

2 Likes