[英]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.