Skip to content

WIDERFace download fails with zip error #4615

@NicolasHug

Description

@NicolasHug

Originally from #4614 (comment)

In [4]: torchvision.datasets.WIDERFace(root='/tmp/lol', split='train', download=True)
91473it [00:00, 9168293.30it/s]
---------------------------------------------------------------------------
BadZipFile                                Traceback (most recent call last)
<ipython-input-4-61c4acdeef4e> in <module>
----> 1 torchvision.datasets.WIDERFace(root='/tmp/lol', split='train', download=True)

~/dev/vision/torchvision/datasets/widerface.py in __init__(self, root, split, transform, target_transform, download)
     70
     71         if download:
---> 72             self.download()
     73
     74         if not self._check_integrity():

~/dev/vision/torchvision/datasets/widerface.py in download(self)
    191             download_file_from_google_drive(file_id, self.root, filename, md5)
    192             filepath = os.path.join(self.root, filename)
--> 193             extract_archive(filepath)
    194
    195         # download and extract annotation files

~/dev/vision/torchvision/datasets/utils.py in extract_archive(from_path, to_path, remove_finished)
    407     extractor = _ARCHIVE_EXTRACTORS[archive_type]
    408
--> 409     extractor(from_path, to_path, compression)
    410
    411     return to_path

~/dev/vision/torchvision/datasets/utils.py in _extract_zip(from_path, to_path, compression)
    281
    282 def _extract_zip(from_path: str, to_path: str, compression: Optional[str]) -> None:
--> 283     with zipfile.ZipFile(
    284         from_path, "r", compression=_ZIP_COMPRESSION_MAP[compression] if compression else zipfile.ZIP_STORED
    285     ) as zip:

~/opt/miniconda3/envs/pt/lib/python3.8/zipfile.py in __init__(self, file, mode, compression, allowZip64, compresslevel, strict_timestamps)
   1267         try:
   1268             if mode == 'r':
-> 1269                 self._RealGetContents()
   1270             elif mode in ('w', 'x'):
   1271                 # set the modified flag so central directory gets written

~/opt/miniconda3/envs/pt/lib/python3.8/zipfile.py in _RealGetContents(self)
   1334             raise BadZipFile("File is not a zip file")
   1335         if not endrec:
-> 1336             raise BadZipFile("File is not a zip file")
   1337         if self.debug > 1:
   1338             print(endrec)

BadZipFile: File is not a zip file

cc @pmeier

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions