【问题标题】:How to use Google Colab on local machine如何在本地机器上使用 Google Colab
【发布时间】:2019-04-25 07:00:00
【问题描述】:

我正在与 Google Colaboratory 合作开展深度学习项目。由于 Google Cloud 上没有足够的存储空间来存储我的训练数据集,因此我尝试在本地计算机上使用 Colab。

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

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

无法连接到运行时。

同时我的 Ubuntu 终端启动:

[W 22:41:53.396 NotebookApp]禁止

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

如何将 Colab 与我的电脑成功连接?

【问题讨论】:

    标签: local google-colaboratory


    【解决方案1】:

    您对jupyter 的调用需要特定的参数来授权 Colab 与之对话。您是否在 jupyter 开始时指定了 args?

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

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

    【讨论】:

    • 这正是问题所在!这些命令行未能将 args 传递给我的 jupyter,因此我通过编辑 jupyter_notebook_config.py 文件来配置这些 args。它终于奏效了。非常感谢你:-D
    • @ZhangYushu 这个命令应该可以打开colab站点吧?我仍然看到它启动了我的本地 jupyter,serving notebooks from local directory: /Users/me/Sites/myprojectany 建议?
    • 我在 Firefox 上发现通过 https 启用 websocket 正在工作,但是在 chrome 上它一直给出 403 错误。我指的是https://research.google.com/colaboratory/local-runtimes.html- 有什么想法可以在 chrome 上解决它吗?
    • 我已经在我的系统上建立了到本地主机的本地运行时连接。我是否可以与网络中的另一台计算机共享此运行时?我尝试使用 IP,但 Google Colab 不允许我使用 localhost 以外的其他方式。
    猜你喜欢
    • 2018-07-03
    • 1970-01-01
    • 2019-04-11
    • 2020-11-15
    • 2020-10-25
    • 1970-01-01
    • 1970-01-01
    • 2019-02-15
    • 2020-07-16
    相关资源
    最近更新 更多