如何在本地机器上使用 Google Colab

How to use Google Colab on local machine

我正在与 Google Colaboratory 合作进行深度学习项目。由于 Google Cloud 上没有足够的存储空间 space 用于我的训练数据集,我尝试在我的本地机器上使用 Colab。

我按照 Google 提供的这些提示将 Colab 连接到我的计算机: https://research.google.com/colaboratory/local-runtimes.html

但是我在第 4 步失败了。Colab 页面出现了:

Unable to connect to the runtime.

与此同时,我的 Ubuntu 终端启动了:

[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

如何才能将 Colab 成功连接到我的电脑?

您对 jupyter 的调用需要特定的参数来授权 Colab 与其对话。您是否使用指示的参数启动 jupyter

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

鉴于 403 是权限错误,我怀疑您可能缺少 NotebookApp.allow_origin 选项。