3

i ma trying to unzip a zip file in google colab and i get this Error

Archive: object_detection.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of object_detection.zip or object_detection.zip.zip, and cannot find object_detection.zip.ZIP, period.

from google.colab import drive
drive.mount('/content/drive')
!cp '/content/drive/My Drive/slim.zip' slim.zip
!unzip object_detection.zip

i already uploded my zip files on the drive

Mohamed Amine
  • 340
  • 1
  • 4
  • 16
  • 1
    Sounds like there is a problem with your zip-file. Does it work locally? Otherwise, you can also try to load your file like described in this thread: https://stackoverflow.com/questions/3451111/unzipping-files-in-python – Solvalou Dec 03 '19 at 21:10
  • IS there a reason why the file you copy is called `slim.zip` and the file you unzip is called `object_detection.zip`? – David Jones Sep 09 '21 at 18:05

3 Answers3

4

I had the same problem and it was because I had not uploaded the file completelyenter image description here

Julian
  • 56
  • 5
1

Probable reason could be your zip file is corrupt.. may be you are not using proper link.. try downloading the file and then uploading on colab.. it should work.

0

If your file is fully uploaded but not unzipped using the unzip command, then try to unzip it using the below program in google colab:

import zipfile
with zipfile.ZipFile('yourfile.zip', 'r') as file:
    file.extractall()