Colab Tutorial 2022
Colab Tutorial 2022
You can create a new code cell by clicking on + Code , clicking on + Text
generates a text cell
There are options for moving your cell up/down or copy or delete it
Code Cell
Text Cell
Getting Started
You can type python code in the code cell, or use a leading exclamation mark !
to change the code cell to treating the input as a shell script
→ python
→ shell script
Getting Started
Using an exclamation mark (!) starts a new shell, does the operations, and
then kills that shell, while percentage (%) affects the process associated with
the notebook, and it is called a magic command.
you can mount your own google drive to colab and directly download/save the
data to your google drive.
Mount Drive:
Mounting Google Drive
Click on the Google Drive icon, the Mount Drive code block will be generated
Mounting Google Drive
Execute the following three code blocks in order
● GPU usage is not unlimited ! (your account will be stopped for a period if you reached
the max gpu usage 12 hrs)
* The cooldown period before you can connect to another GPU will extend from hours to days to
weeks depending on your usage
Best solution:
1. buy colab pro :)
2. use your own resource (if able)
Reminder: TAs are not required to help you solve environment problems
Reference
● https://colab.research.google.com
● https://research.google.com/colaboratory/faq.html