简体   繁体   English

google.colab 模块中是否有 function 来关闭运行时

[英]Is there a function in google.colab module to close the runtime

Sometimes when I give run in google.colab I cant stay infront of the computer to manually disconnect from the server when the run is complete and the connection stays on even when my run is complete occupying the node for no reason.有时,当我在 google.colab 中运行时,我无法在运行完成时手动断开与服务器的连接,即使我的运行完成无缘无故地占用节点,连接仍保持打开状态。

Is there a function in google.colab so that say I can insert the function to close the connection after some epochs? google.colab 中是否有 function 以便说我可以插入 function 以在一些时期后关闭连接? I am looking for something like colab.disconnect() etc...我正在寻找诸如 colab.disconnect() 之类的东西...

import sys
sys.exit()

This will end the runtime, freeing up the GPU. 这将结束运行时,释放GPU。

EDIT: Apparently my last answer doesn't work any more. 编辑:显然我的最后一个答案不起作用了。 The thing to do now is !kill -9 -1 . 现在要做的是!kill -9 -1

quit() and exit() are not executed in google colab (18 Aug 2019). 谷歌合作实验室不执行quit()exit() (2019年8月18日)。 Just type the following: 只需输入以下内容:

!kill -9 -1

We have a way to do this correctly now:我们现在有办法正确地做到这一点:

from google.colab import runtime
runtime.unassign()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何解决 ModuleNotFoundError:没有名为“google.colab”的模块 - How to resolve ModuleNotFoundError: No module named 'google.colab' 在 Google.colab 中安装 Openpyxl - Openpyxl installation in Google.colab 在 Pycharm 中寻找 google.colab 替代品 - Looking for a google.colab substitute in Pycharm 如何访问 google.colab 中 object 中的每个元素? - How to access each element in object in google.colab? 在 VM 引擎中导入 google.colab 不会让我在 Google Colab 中运行 Jupyter Notebook? - Importing google.colab in VM Engine Doesn't Let me Run Jupyter Notebook in Google Colab? 使用google.colab导入文件在Google collab上的协作者无法获得的数据 - Data unavailable to Collaborators on google collab using google.colab import files 从 google.colab 导入文件,如何在 Jupyterlab 中获取文件的相同行为 - from google.colab import files, how to get the same behaviour of files in Jupyterlab 如何使用 google.colab 导入文件上传文本文件,然后将其转换为一组单词? - How to upload a text file using google.colab import files and then converting it into a set of words? pip 安装了 google.colab,现在无法在 Jupyter 笔记本上运行代码 - pip installed google.colab and now unable to run code on Jupyter notebook Google Colab 无法识别的运行时 - Google Colab Unrecognized Runtime
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM