Skip to content
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

Not able to find ImageNet images #1

Closed
AhmadObeid opened this issue Oct 9, 2019 · 1 comment
Closed

Not able to find ImageNet images #1

AhmadObeid opened this issue Oct 9, 2019 · 1 comment

Comments

@AhmadObeid
Copy link

Thank you for the code.

There is a RuntimeError getting raised because apparently the code is not able to find the images of ImageNet.

The error is raised when calling ImageFolder class, from within imagenetloader.py, specifically, inside the object ImageNetLoader30. Upon having a closer look at ImageNetLoader30, I found the following line:
samples_30 = make_dataset(path+'images/{}'.format(subfolder), classes_30, class_to_idx_30),
where path = './data/datasets/ImageNet', and subfolder = 'train'.

And when viewing samples_30 after this line, I get nothing but an empty array.
That's why when ImageFolder is called with this empty array as shown in the following line
dataset = ImageFolder(transform=transform, samples=samples_30)

, it prompts the mentioned error.

Does that mean that in the path directory, we should manually create a folder called train (possibly for testing and validation too) and populate it with the images belonging to the categories described by the WNIDs?

I thought that that would be done automatically as part of the pipeline but as the error is getting raised, maybe it is not?

Thank you in advance.

Ahmad

@k-han
Copy link
Owner

k-han commented Jan 18, 2020

Hi,
The ImageNet dataset folder is organized as follow.

ImageNet/imagenet_rand118 #downloaded by the command provided
ImageNet/images/train #standard ImageNet training split
ImageNet/images/val #standard ImageNet validation split
The has been included in the updated README.

@k-han k-han closed this as completed Jan 20, 2020
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

2 participants