Hi !
As @jeremy had uploaded an early draft of the notebooks for the Part 2 v2, I decided to try these on Google Colab. For those unaware of Google Colab, it offers GPU as a backend for free for 12 hours at a time. You can check it at https://colab.research.google.com
I feel many might not be able to afford a GPU for training the models that are built in the course and it shall be a great help for them to have the notebooks and setup instructions for Colab so that they can try the teachings of the course themselves, that too for free.
I shall be maintaining a list of notebooks in this thread which can be directly run on Collab to try whatever is taught over the next 7 weeks.
Setup
To set up your Colab VM for Fast AI, you can download the linked notebook: fastAI_part2_v2_colab/FastAI_v2_setup.ipynb at master · Naman-Bhalla/fastAI_part2_v2_colab · GitHub . Please note that you need to run it every time a new VM instance is created.
Upload the notebook to your Google Drive. Go to https://colab.research.google.com and open FastAI_v2_setup.ipynb from File → open Drive Notebook → My Drive.
After it opens, go to Runtime → Change Runtime Type and make sure Hardware Accelerator is GPU.Finally, go to Runtime and select Run All.
The following cells shall connect your Google Drive with Colab (for permanent file saving), setup FastAI, PyTorch, all dependencies and also download the datasets at the correct locations (At the moment, only dataset for pascal.ipynb is downloaded but I shall keep it updated with all the datasets as the course progresses.) It shall save the notebooks for the lectures covered till date in your Google Drive in fastai_v2_colab folder.
Would like to add a note about Google Drive integration. There shall be 2 prompts when the particular cell will run. Click on the links in the prompt, choose your Google account, allow access, and then copy the secure key generated into the box.
That’s it. The particular VM instance of Colab is ready to host your lecture notebooks. Go to your Drive and open the lecture notebooks directly or check modified ones below (Ensure their Runtime Type is also GPU Hardware Accelerated). Make sure to run the Setup notebook each time a new VM instance is created by you (~ When you open notebook after 12 hours).
Lecture Notebooks
Often due to limitations of Colab, there might be a possibility of the lecture notebooks not working as it is. Though I will try my best to make sure notebooks run without any changes, but in case some changes are needed, I will be uploading the modified notebooks in the repository. For most of the notebooks, only thing that needs to be changed shall be commenting out the matplotlib magic functions in the first cell
(%matplotlib inline
%reload_ext autoreload
%autoreload 2)
Just download the notebooks, upload them to a suitable directly in your Drive, open via Collaboratory, change Runtime Type to GPU and that’s it !! If any error, double check that you had run the Setup notebook, or run it again !
pascal.ipynb : fastAI_part2_v2_colab/pascal.ipynb at master · Naman-Bhalla/fastAI_part2_v2_colab · GitHub
As this is still an early draft, forum members have found an IndexError, possibly because of padding ? I have modified the notebook to remove the error (the error is not fixed yet, though ! I just commented out the lines mentioned by @belskikh here . Though this affects the final results, and the bounding boxes appear incorrectly as can be seen here , I am sure @jeremy will provide solution or fix this soon, I have uploaded the modified notebook so that if someone wishes to try the notebook before lecture starts.
When I ran pascal.ipynb m, it took less than 7 mins for the complete notebook to run. So, yes, Colab is very fast, after all you have Tesla K80 at your disposal !! I hope this thread gives relief to ones concerned about buying a GPU or paying for AWS to finish the course.
See you all in the course !
Regards.