【问题标题】:How to upload hdf5 files of huge size into google colab?如何将巨大的 hdf5 文件上传到谷歌 colab?
【发布时间】:2018-10-30 03:07:37
【问题描述】:

我有一个大小为 17GB 的 hdf5 文件(图像数据集),我需要将其上传并在 Google Colab 中使用,并在此数据集上训练我的模型。但是,当我使用以下代码从驱动器上传时,运行时间会在身份验证过程后自动断开连接。是因为文件大小还是其他问题?有什么解决方案可以克服这个问题吗?

代码sn-p如下:

from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from google.colab import auth
from oauth2client.client import GoogleCredentials

#Authenticate and create the PyDrive client.
auth.authenticate_user()
gauth = GoogleAuth()
gauth.credentials = GoogleCredentials.get_application_default()
drive = GoogleDrive(gauth)

# Get the file
downloaded = drive.CreateFile({'id': 'my_id'}) #replace the my_id with id of file you want to access
downloaded.GetContentFile('dataset.hdf5')

【问题讨论】:

  • 您是否解决了将 hdf5 文件导入 colab 的问题?您介意在此处分享您的解决方案的 colab 笔记本吗?

标签: conv-neural-network hdf5 google-colaboratory pydrive


【解决方案1】:

如果数据集来自 kaggle,则向 Colab 提供 git url,它将自动下载。否则,您将受到互联网连接的支配。

【讨论】:

    猜你喜欢
    • 2021-05-14
    • 2021-11-07
    • 2020-12-10
    • 2020-02-02
    • 2021-06-13
    • 2020-04-10
    • 1970-01-01
    • 2020-12-05
    • 2022-08-13
    相关资源
    最近更新 更多