如何从本地驱动器上传大数据并将其保存到Google Colaboratory?

Geo*_*eRF 6 python google-drive-api deep-learning jupyter-notebook google-colaboratory

我从这个Kaggle链接下载了大图像训练数据作为zip

https://www.kaggle.com/c/yelp-restaurant-photo-classification/data

我如何有效地实现以下目标?

  1. 在Google Colaboratory中创建一个项目文件夹
  2. 将zip文件上传到项目文件夹
  3. 解压缩文件

谢谢

编辑:我尝试了下面的代码,但它崩溃了我的大型zip文件.有没有更好/更有效的方法来执行此操作,我可以在本地驱动器中指定文件的位置?

from google.colab import files
uploaded = files.upload()

for fn in uploaded.keys():
  print('User uploaded file "{name}" with length {length} bytes'.format(
      name=fn, length=len(uploaded[fn])))
Run Code Online (Sandbox Code Playgroud)

abi*_*ita 2

您可以参考以下主题:

另请查看I/O 示例笔记本。例如,要访问xls文件,您需要将文件上传到 Google 表格。然后,您可以gspread在同一 I/O 示例笔记本中使用这些配方。