google.colab 模块中是否有关闭运行时的功能 [英] Is there a function in google.colab module to close the runtime

查看:15
本文介绍了google.colab 模块中是否有关闭运行时的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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.

Is there a function in google.colab so that say I can insert the function to close the connection after some epochs? I am looking for something like colab.disconnect() etc...

解决方案

import sys
sys.exit()

This will end the runtime, freeing up the GPU.

EDIT: Apparently my last answer doesn't work any more. The thing to do now is !kill -9 -1.

这篇关于google.colab 模块中是否有关闭运行时的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆