相关疑难解决方法(0)

从Google colab笔记本中提取Google Drive zip

我已经在谷歌硬盘上有一个(2K图像)数据集的拉链.我必须在ML训练算法中使用它.Code下面以字符串格式提取内容:

from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from google.colab import auth
from oauth2client.client import GoogleCredentials
import io
import zipfile
# Authenticate and create the PyDrive client.
# This only needs to be done once per notebook.
auth.authenticate_user()
gauth = GoogleAuth()
gauth.credentials = GoogleCredentials.get_application_default()
drive = GoogleDrive(gauth)

# Download a file based on its file ID.
#
# A file ID looks like: laggVyWshwcyP6kEI-y_W3P8D26sz
file_id = '1T80o3Jh3tHPO7hI5FBxcX-jFnxEuUE9K' #-- Updated File ID for my zip
downloaded = drive.CreateFile({'id': file_id})
#print('Downloaded …
Run Code Online (Sandbox Code Playgroud)

python machine-learning zipfile google-drive-api google-colaboratory

8
推荐指数
10
解决办法
3万
查看次数