Google Colab:关于VM上文件的生存期 [英] Google Colab: about lifetime of files on VM
问题描述
有人知道colab虚拟机上文件的生存期吗?例如,在colab笔记本中,我将数据另存为csv文件:
data.to_csv('data.csv')
那么data.csv将存在多长时间?
这是方案:我想每天维护和更新3000多个小型数据集,但是似乎通过使用pydrive来进行colab和google drive之间的交互非常慢(因为我需要每天检查每个数据集),因此虚拟机上文件的生命周期是否合理足够长了,我可以每天更新虚拟机上的文件(这会更快),然后一次而不是每天数天将它们同步到google驱动器.
一段时间不活动后,将丢弃虚拟机,因此,最好的选择是将文件保存到要保留为生成状态的云端硬盘中.
使用 pydrive
可以实现,但有点麻烦.一种更简单的方法是使用FUSE界面驱动器,以便您可以自动同步正常保存的文件.
有关示例,请参见: https://colab.research.google.com/drive/1srw_HFWQ2SMgmWIawucXfusGzrj1_U0q> is there anyone knows the lifetime of files on the colab virtual machine?
for example, in a colab notebook, I save the data to a csv file as: then how long will the data.csv exist? This is the scenario:
I want to maintain and update over 3000 small datasets everyday, but it seems that the interaction between colab and google drive by using pydrive is pretty slow(as I need to check every dataset everyday), so if the lifetime of files on the virtual machine is long enough, I can update the files on virtual machine everyday(which would be much faster) then synchronize them to google drive several days a time rather than everyday. VMs are discarded after a period of inactivity, so your best bet is to save files to Drive that you'd like to keep as generated. With For an example, see:
https://colab.research.google.com/drive/1srw_HFWQ2SMgmWIawucXfusGzrj1_U0q 这篇关于Google Colab:关于VM上文件的生存期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!data.to_csv('data.csv')
pydrive
, this is possible, but a bit cumbersome. An easier method is to use a FUSE interface to Drive so that you can automatically sync files as they are saved normally.