How do I unzip large files (>1Gb) from my Drive into Colab?

人走茶凉 提交于 2021-02-11 13:35:33

问题


I tried to unzip large zipfiles from my Drive into my Colab and got this error:

BadZipFile: zipfiles that span multiple disks are not supported

How do I unzip large files from Drive into Colab?


回答1:


Im doing that with two options:

!unzip file_location -d file_destination #-d is for quite option.

Or other option more elaborate:

import zipfile
from google.colab import drive

drive.mount('/content/drive/')

zip_ref = zipfile.ZipFile("/content/drive/My Drive/ML/DataSet.zip", 'r')
zip_ref.extractall("/tmp")
zip_ref.close()


来源:https://stackoverflow.com/questions/60143107/how-do-i-unzip-large-files-1gb-from-my-drive-into-colab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!