更新时间:2022-03-24 21:49:35
步骤:
转到Google colab
并单击连接到本地运行时",将弹出一个窗口.
Go to Google colab
and click on connect to local runtime, a pop-up comes.
转到您的终端并执行:
jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=8888 --NotebookApp.port_retries=0
如果显示错误:
ERROR: the notebook server could not be started because port 8888 is not available.
然后运行以下命令以基本终止使用该进程或使用其他端口的任何进程:
Then run the following to basically kill any process using it or use another port:
lsof -wni tcp:8888
kill -9 <JOB_ID>
lsof -wni tcp:8888
kill -9 <JOB_ID>
如果成功,则该命令将提供一个链接:
If successful, then the command gives a link:
例如:
http://localhost:8888/?token=bb80b05aef71999353fe4715e0f06be40d22911648dbdcd6
将其复制到colab的弹出窗口中,就可以开始了.
Copy it in the pop-up in the colab and you are set to go.