Kir*_*rot 1 keras tensorflow jupyter-notebook google-colaboratory
目前,我处理 400 多张图片并上传它们
from google.colab import files
uploaded = files.upload()
Run Code Online (Sandbox Code Playgroud)
这个工作正常,但每次离开我的合作实验室时我都必须重新上传所有图像。很烦人,因为上传需要 5-10 分钟。
有没有可能阻止这种情况?Colaboratory 似乎只是暂时保存文件。
我必须使用 Google Colaboratory,因为我需要他们的 GPU。
提前致谢 :)
小智 6
据我所知,无法将数据永久存储在 Google Colab 虚拟机上,但在 Colab 上上传数据的方法比 files.upload() 更快。
例如,您可以将图像上传到 Google Drive 一次,然后 1) 直接在您的 VM 中安装 Google Drive 或 2) 使用 PyDrive 在您的 VM 上下载您的图像。这两个选项都应该比从本地驱动器上传图像快得多。
在 VM 中安装驱动器
挂载 Google 云端硬盘:
from google.colab import drive
drive.mount('/gdrive')
Run Code Online (Sandbox Code Playgroud)打印foo.txt
位于 Drive 根目录中的内容:
with open('/gdrive/foo.txt') as f:
for line in f:
print(line)
Run Code Online (Sandbox Code Playgroud)使用 PyDrive
看看这个问题的第一个答案。
归档时间: |
|
查看次数: |
6070 次 |
最近记录: |