Skip to content

Imagenet download url in imagenet.py doesn't work #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kanonjz opened this issue Nov 11, 2019 · 10 comments
Closed

Imagenet download url in imagenet.py doesn't work #19

kanonjz opened this issue Nov 11, 2019 · 10 comments

Comments

@kanonjz
Copy link
Contributor

kanonjz commented Nov 11, 2019

Imagenet doesn't support direct download, is there any solution?

@deepakn94
Copy link
Collaborator

It seems like this has been deprecated recently: pytorch/vision#1453.

You will need to figure out a way to download the dataset manually; http://www.image-net.org/challenges/LSVRC/2012/ has more information.

@kanonjz
Copy link
Contributor Author

kanonjz commented Nov 11, 2019

Thanks, I'll download the dataset manually. But how did you organize the dataset file, could you show me the structure?

@deepakn94
Copy link
Collaborator

See this: https://pytorch.org/docs/stable/torchvision/datasets.html#torchvision.datasets.ImageFolder. Basically something like [train|val]/[label]/[image name].jpg.

@RylanSchaeffer
Copy link

@deepakn94 , I downloaded a subset of the data and arranged it as you suggested, but I get an error: {RuntimeError}('Meta file not found or corrupted.', 'You can use download=True to create it.')

What's this meta file and where can I get it?

@deepakn94
Copy link
Collaborator

You don't need to run the download_imagenet.py script if you have the train and val directories setup as described above.

@deepakn94
Copy link
Collaborator

I am going to close this -- please let me know if this did not work for you!

@kanonjz
Copy link
Contributor Author

kanonjz commented Dec 6, 2019

sorry, I guess it still needs to run the download_imagenet.py,because the original val file structure is [val] / [image name].jpeg 。But it requires [val]/[label]/[image name].jpeg, which is what download_imagenet.py do. I got an error when run profile:

=> creating model 'vgg16' Traceback (most recent call last): File "main.py", line 574, in <module> main() File "main.py", line 249, in main normalize, File "/opt/conda/lib/python3.6/site-packages/torchvision/datasets/folder.py", line 178, in __init__ target_transform=target_transform) File "/opt/conda/lib/python3.6/site-packages/torchvision/datasets/folder.py", line 79, in __init__ "Supported extensions are: " + ",".join(extensions))) RuntimeError: Found 0 files in subfolders of: /root/dataset/val Supported extensions are: .jpg,.jpeg,.png,.ppm,.bmp,.pgm,.tif

I still don't know how to fix the problem, do you have any suggestion?

@deepakn94
Copy link
Collaborator

What do you see if you do /root/dataset/val?

@deepakn94 deepakn94 reopened this Dec 6, 2019
@kanonjz
Copy link
Contributor Author

kanonjz commented Dec 8, 2019

Hi, Deepak. I modified the two files scripts/download_imagenet.py and scripts/imagenet.py. I removed download ImageNet and tested the code successfully. You can see the pull request.

@deepakn94
Copy link
Collaborator

Great, I merged the PR! Going to close this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants