久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

從 Google colab 筆記本中提取 Google Drive zip

Extract Google Drive zip from Google colab notebook(從 Google colab 筆記本中提取 Google Drive zip)
本文介紹了從 Google colab 筆記本中提取 Google Drive zip的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我已經(jīng)在谷歌驅(qū)動器上有一個(2K 圖像)數(shù)據(jù)集的壓縮包.我必須在 ML 訓(xùn)練算法中使用它.下面的代碼以字符串格式提取內(nèi)容:

I already have a zip of (2K images) dataset on a google drive. I have to use it in a ML training algorithm. Below Code extracts the content in a string format:

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 content "{}"'.format(downloaded.GetContentString(encoding='cp862')))

但我必須將其提取并存儲在單獨的目錄中,因為這樣更容易處理(以及理解)數(shù)據(jù)集.

But I have to extract and store it in a separate directory as it would be easier for processing (as well as for understanding) of the dataset.

我試圖進一步提取它,但得到不是 zipfile 錯誤"

I tried to extract it further, but getting "Not a zipfile error"

dataset = io.BytesIO(downloaded.encode('cp862'))
zip_ref = zipfile.ZipFile(dataset, "r")
zip_ref.extractall()
zip_ref.close()

Google 云端硬盤數(shù)據(jù)集

注意:數(shù)據(jù)集僅供參考,我已經(jīng)將這個 zip 下載到我的 google 驅(qū)動器中,我指的只是驅(qū)動器中的文件.

Note: Dataset is just for reference, I have already downloaded this zip to my google drive, and I'm referring to file in my drive only.

推薦答案

你可以簡單的使用這個

!unzip file_location

這篇關(guān)于從 Google colab 筆記本中提取 Google Drive zip的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Troubles while parsing with python very large xml file(使用 python 解析非常大的 xml 文件時出現(xiàn)問題)
Find all nodes by attribute in XML using Python 2(使用 Python 2 在 XML 中按屬性查找所有節(jié)點)
Python - How to parse xml response and store a elements value in a variable?(Python - 如何解析 xml 響應(yīng)并將元素值存儲在變量中?)
How to get XML tag value in Python(如何在 Python 中獲取 XML 標(biāo)記值)
How to correctly parse utf-8 xml with ElementTree?(如何使用 ElementTree 正確解析 utf-8 xml?)
Parse XML from URL into python object(將 XML 從 URL 解析為 python 對象)
主站蜘蛛池模板: 午夜影视网| 国产精品国产a | 高清国产午夜精品久久久久久 | 91电影在线 | 久久伊人一区 | 一区二区三区欧美在线 | 一级中国毛片 | 欧美性极品xxxx做受 | 国产清纯白嫩初高生在线播放视频 | 一区二区在线看 | 亚洲国产欧美91 | 亚洲天堂精品一区 | 91欧美 | 交专区videossex农村 | 国产精品一区二区久久 | 国产精品亚洲视频 | 综合在线视频 | 天天综合永久入口 | 日韩中文字幕av | 一区二区三区韩国 | 日韩在线欧美 | 在线观看中文字幕 | 天天干狠狠操 | 91视视频在线观看入口直接观看 | 精品亚洲一区二区 | 国产精品视频97 | 成人免费看黄网站在线观看 | 国产免费一二三区 | www312aⅴ欧美在线看 | 99热国产在线播放 | 亚洲 中文 欧美 日韩 在线观看 | 国产精品久久久久久久久久久久久 | 一级二级三级黄色 | 在线视频91 | 99精品99久久久久久宅男 | 国产色网 | av一区在线| 国产高清视频 | 久久久久久久久国产成人免费 | 一区二区在线不卡 | 精品欧美色视频网站在线观看 |