如何将云端硬盘中的大文件(> 1Gb)解压缩到Colab中? [英] How do I unzip large files (>1Gb) from my Drive into Colab?

查看:83
本文介绍了如何将云端硬盘中的大文件(> 1Gb)解压缩到Colab中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将云端硬盘中的大型zipfile解压缩到Colab中,并出现此错误:

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

如何将云端硬盘中的大文件解压缩到Colab中?

How do I unzip large files from Drive into Colab?

推荐答案

我这样做有两个选择:

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

或更详细的其他选择:

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()

这篇关于如何将云端硬盘中的大文件(> 1Gb)解压缩到Colab中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆