Python
jupyter notebook
google-colab
anaconda
Google Colab (or Google Colaboratory) is a cloud-based notebook environment that allows you to run Python code without needing to install anything on your computer. It is ideal for learning, experimenting, and carrying out small to medium-sized projects with free access to GPUs and TPUs.
However, Colab has limited resources, which means that:
Limited RAM and CPU
Maximum Runtime
Restricted Access to GPU and TPU
You can use a GPU to accelerate calculations with TensorFlow or PyTorch, but access is not always guaranteed. If many people are using Colab at the same time, you might not get an available GPU.
If you want to check if you have a GPU enabled, follow these steps:
Open a notebook in Google Colab.
Create a new code cell.
Write the following command and execute it (by pressing Shift + Enter or clicking the "Run" button):
1!nvidia-smi
If a GPU is enabled, you will see information about the model and usage of the graphics card. If nothing appears or you see an error, it means that Colab did not assign you a GPU in that session.
Data Loss if the Environment is Restarted
To avoid losing files when Colab restarts, you can connect it to your Google Drive.
How to connect Google Colab with Google Drive?
Open a notebook in Google Colab.
Create a new code cell and execute the following command:
1from google.colab import drive 2drive.mount('/content/drive')
What this code does is:
If you need more resources or unlimited time, consider installing Jupyter Notebook or using a local environment like Anaconda. The steps to install Jupyter Notebook on your PC would be:
Download and install Anaconda from https://www.anaconda.com/.
Open Anaconda and run:
1jupyter notebook
Your browser will open with an environment similar to Google Colab, but using the resources of your PC.
If you need more RAM or guaranteed access to GPUs, Google offers Colab Pro (paid), which gives you better resources and more runtime.
💡 Google Colab is excellent for quick tests and small projects, but if you need more computing power, it is best to work on your own computer or on more powerful servers.