我有一个17 of大小的hdf5文件(图像数据集),我需要上传并在Google Colab中使用,并在此数据集上训练我的模型。但是,当我使用以下代码从我的驱动器上传时,运行时在身份验证过程之后会自动断开连接。是因为文件的大小还是其他问题?有什么解决方案可以克服这个问题吗?
代码片段如下:
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')发布于 2018-05-29 06:35:23
如果数据集来自kaggle,向Colab提供git url,Colab将自动下载。否则,你只能任由你的互联网连接摆布。
https://stackoverflow.com/questions/50432245
复制相似问题