Skip to content

Conversation

edgarriba
Copy link
Contributor

hi ! I had to make this work around while using WiderFace dataset from downloaded directories.

Besides, in my computer seems that downloading doesn't work as expected.

@NicolasHug
Copy link
Member

hi @edgarriba ,

I think the reason we call _check_integrity() unconditionally is to make sure that all files are being present, no matter how the dataset was downloaded.

Could you detail what command you ran and the error you were getting? It's possible that the integrity check is a bit too strong, or that the dataset that you have is missing some parts.

@NicolasHug
Copy link
Member

CCing @pmeier on this one

@datumbox datumbox requested a review from pmeier October 14, 2021 15:14
@edgarriba
Copy link
Contributor Author

I'm using WIDERFace in the follwing way:

    train_dataset = torchvision.datasets.WIDERFace(
        root=to_absolute_path(config.data_path), transform=T.ToTensor(), split='train', download=False)

and below is the error I get:

Traceback (most recent call last):
  File "/home/edgar/software/kornia/examples/train/object_detection/main.py", line 28, in my_app
    root=to_absolute_path(config.data_path), transform=T.ToTensor(), split='train', download=False)
  File "/home/edgar/software/vision/torchvision/datasets/widerface.py", line 76, in __init__
    "Dataset not found or corrupted. " + "You can use download=True to download and prepare it"
RuntimeError: Dataset not found or corrupted. You can use download=True to download and prepare it

I directly downloaded the dataset from the official website (and arranged as described in the docstring) because when using the flag download==True I got also some issues (before forking and debugging)

Traceback (most recent call last):
  File "/home/edgar/software/kornia/examples/train/object_detection/main.py", line 28, in my_app
    root=to_absolute_path(config.data_path), transform=T.ToTensor(), split='train', download=True)
  File "/home/edgar/software/vision/torchvision/datasets/widerface.py", line 72, in __init__
    self.download()
  File "/home/edgar/software/vision/torchvision/datasets/widerface.py", line 193, in download
    extract_archive(filepath)
  File "/home/edgar/software/vision/torchvision/datasets/utils.py", line 409, in extract_archive
    extractor(from_path, to_path, compression)
  File "/home/edgar/software/vision/torchvision/datasets/utils.py", line 284, in _extract_zip
    from_path, "r", compression=_ZIP_COMPRESSION_MAP[compression] if compression else zipfile.ZIP_STORED
  File "/home/edgar/software/kornia/.dev_env/envs/venv/lib/python3.7/zipfile.py", line 1258, in __init__
    self._RealGetContents()
  File "/home/edgar/software/kornia/.dev_env/envs/venv/lib/python3.7/zipfile.py", line 1325, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

@NicolasHug
Copy link
Member

Thanks @edgarriba , I can reproduce the zip issue, I opened #4615 which we will investigate.

It's good that you find a workaround in the mean time, but let's wait until we fix the original issue before going back to this PR

Copy link
Collaborator

@pmeier pmeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can probably be closed in favor of #4649.

@edgarriba
Copy link
Contributor Author

👍

@edgarriba edgarriba closed this Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants