python - 我可以运行 Google Colab(免费版)脚本然后关闭计算机吗?

标签 python google-colaboratory

我可以运行 google colab(免费版)脚本然后关闭计算机吗?

我正在使用交叉验证训练多个深度学习模型,因此我想知道是否可以关闭窗口或计算机,同时在云端进行训练。

最佳答案

Edited: With the browser closed, a Colabs instance will run for at most 12 hours 90 minutes before your runtime is considered idle and is recycled.

同时,最好定期保存模型权重以避免丢失工作。


详细信息:

“空闲”和“最大生命周期”持续时间没有官方引用,但 testing done by Korakot Chaovavanich表明:

  • 正在运行的笔记本的“最长生命周期”12 小时(浏览器打开)
  • “空闲” 笔记本实例在 90 分钟
  • 后关闭
  • 您最多可以同时运行 2 个笔记本
  • 如果在实例仍在运行时关闭并打开笔记本窗口,单元格输出和变量仍将保留。但是,如果笔记本实例已被回收,您的单元格输出和变量将不再可用。

您可以尝试一种偷偷摸摸的解决方法,即在您的移动浏览器中打开 Colabs 实例,以防止该实例被视为“空闲”。


根据个人经验,您自己的里程数会有所不同,我有时会稍微缩短持续时间。但是只要你检查你的模型(定期保存训练权重),你应该能够在 VM 被回收之前完成大量的训练,之后你可以简单地将权重加载到新 VM 实例上的模型中并恢复训练。

但是,如果您想一次性训练您的模型超过 12 小时,您可以 run Google Colaboratory on a local instance或标准的 Jupyter Notebook。但是您会放弃 Colaboratory 提供的免费 G​​PU/TPU。 (检查点在这里仍然是个好主意!)


相关问题来自Google Colaboratory FAQ :

Where is my code executed? What happens to my execution state if I close the browser window?

Code is executed in a virtual machine dedicated to your account. Virtual machines are recycled when idle for a while, and have a maximum lifetime enforced by the system.

How may I use GPUs and why are they sometimes unavailable?

Colaboratory is intended for interactive use. Long-running background computations, particularly on GPUs, may be stopped. Please do not use Colaboratory for cryptocurrency mining. Doing so is unsupported and may result in service unavailability. We encourage users who wish to run continuous or long-running computations through Colaboratory’s UI to use a local runtime.

关于python - 我可以运行 Google Colab(免费版)脚本然后关闭计算机吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55050988/

相关文章:

python - 正则表达式匹配?

Python 3 更改 for 循环中字典键的值不起作用

Python-除一个索引外如何排序

python - Google Colab - 从 GitHub 安装? GLRM

python - 属性错误: module 'gspread' has no attribute 'service_account'

io - 在哪里可以在 Colaboratory 上配置 iopub_data_rate_limit?

python - 如果发生这种情况,我该如何安装 PIL?

python - 如何根据列条件重命名 pandas DataFrame 索引

python - 从 Google Colab 连接到 Postgresql 数据库

c++ - Google Colab中的CHECK(call)函数获取错误