Unzipping image directory in Google Colab doesn't unzip entire contents

给你一囗甜甜゛ 提交于 2020-04-17 22:39:11

问题


I'm trying to unzip a directory of 75,000 images for training a CNN. When unzipping using,

!unzip -uq "/content/BDD_gt_8045.zip" -d "/content/drive/My Drive/Ground_Truth"

not all images unzip. I have about 5,000 I believe. I tried doing it several times but then I have some duplicates. Is there a limit to the number of images I can unzip?

I'm currently stuck on how else I'm meant to get all files into my drive to train the model.


回答1:


Colab's default 'unzip' binary doesn't work as expected. It seems to cancel the unzipping automatically after a few cycles. Run latest version of 7z and you are good to go.

# To extract with full paths
!7z x <filename.zip>

# To extract all the files in the same folder (ignore paths)
!7z e <filename.zip>

# To specify output directory, use '-o'
!7z x <filename.zip> -o '/content/drive/My Drive/Datasets/FashionMNIST'



来源:https://stackoverflow.com/questions/61110400/unzipping-image-directory-in-google-colab-doesnt-unzip-entire-contents

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