Closed slipnitskaya closed 3 years ago
@slipnitskaya Thanks for reporting. I don't think simply allowing redirects will do it because the website now hosts the dataset on google drive.
@pmeier Thoughts?
I never had to deal with redirects so take what I say with a grain of salt.
@slipnitskaya I agree, handling redirects is a good addition and I will review your PR later on. That being said I think @datumbox is right that redirecting won't help you with your problem since download_url
does not work for files on Google Drive.
In order achieve what you want, we could include a simple regular expression in the beginning of download_url
that checks if we want to download from google drive. If that is the case it could dispatch the call to download_file_from_google_drive
.
Thanks for reviewing!
@pmeier Would be great indeed to add support for dispatching of download requests to Google Drive inside download_url
.
I could implement this feature, so it could be merged into the upstream sooner.
Sounds good @slipnitskaya! I think we should split this into two separate PRs. You can simply ping me when it is ready for review.
@pmeier Dispatching of requests to Google Drive has been added to download_url()
(PR #3245)
Closed in #3236.
🐛 Bug
torchvision.datasets.utils.download_url() processes redirects incorrectly. An attempt to download via URL that returns redirect headers fails and results in an empty file.
To Reproduce
The behavior can be reproduced using link to the CUB-200-2011 dataset. Here's the example execution:
Expected behavior
The file is expected to be downloaded correctly given URL.
Environment
cc @pmeier