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
Try importing google.colab
try: import google.colab IN_COLAB = True except: IN_COLAB = False
Or just check if it's in sys.modules
import sys IN_COLAB = 'google.colab' in sys.modules