How can I test if my notebook is running on Google Colab?
I need this test as obtaining / unzipping my training data is different if running on my laptop or on Colab
you can check environment variable like this:
import os if 'COLAB_GPU' in os.environ: print("I'm running on Colab")
actually you can print out os.environ to check what's associated with colab and then check the key