Search code examples
localgoogle-colaboratory

How to use Google Colab on local machine


I'm working on deep-learning projects with Google Colaboratory. Because there isn't enough storage space on Google Cloud for my training datasets, I try to use Colab on my local machine.

I followed these tips provided by Google to connect Colab with my computer: https://research.google.com/colaboratory/local-runtimes.html

but I failed at Step 4. The Colab page raised:

Unable to connect to the runtime.

Meanwhile my Ubuntu terminal raised:

[W 22:41:53.396 NotebookApp]Forbidden

[W 22:41:53.396 NotebookApp] 403 GET /api/kernelspecs (10.133.6.71) 1.45ms referer=None

How can I successfully connect Colab with my pc?


Solution

  • Your invocation of jupyter needs particular arguments to authorize Colab to speak to it. Did you start jupyter with the args indicated?

    jupyter notebook \
      --NotebookApp.allow_origin='https://colab.research.google.com' \
      --port=8888 \
      --NotebookApp.port_retries=0
    

    Given that a 403 is a permissions error, I suspect you might be missing the NotebookApp.allow_origin option.