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

Does not process images #1

Open
adbugger opened this issue Aug 31, 2019 · 6 comments
Open

Does not process images #1

adbugger opened this issue Aug 31, 2019 · 6 comments

Comments

@adbugger
Copy link

adbugger commented Aug 31, 2019

Running the following command:
python tiered_imagenet_generator.py --tar_dir [your_path_of_the_ILSVRC2012_img_train.tar]

creates the directory structure: tiered-imagenet/train/n**/ but no files.
Further, the processed_images directory is not created.

I tried the same command with the mini-imagenet-tools repo and it works correctly, so I'm assuming that my tar-file is fine.

@adbugger adbugger changed the title Empty folders created Does not process images Aug 31, 2019
@yaoyao-liu
Copy link
Owner

I am very sorry that I don't have time to check this repo. You may directly download processed image using following link:
https://meta-transfer-learning.yyliu.net/download/

@akinaka0x
Copy link

akinaka0x commented Nov 15, 2019

I had the same problem.
Replacing line 82 with image_path = glob(os.path.join(img_dir, split, keys, '*')) worked for me.

@yaoyao-liu
Copy link
Owner

I had the same problem.
Replacing line 82 with image_path = glob(os.path.join(img_dir, split, keys, '*')) worked for me.

Thanks for your contribution. You may create a pull request and I'll merge it.

@akinaka0x
Copy link

akinaka0x commented Nov 15, 2019

Replacing line 82 with image_path = glob(os.path.join(img_dir, split, keys, '*')) worked for me.

It turned out the code I posted above was wrong, and I am really sorry for the confusion.
The code I posted above worked for train dataset by accident and does not work for val and test sets of the tiered-ImageNet dataset.

The original code is correct, and the reason I had the problem was that I wrongly specified the --imagenet_dir.
It seems the ImageNet directory structure is assumed to be like this in the program:

[--imagenet_dir] --- n01440764 --- *.JPEG
                  |             |- *.JPEG
                  |
                  |
                  |- n01443537 --- *.JPEG
                  |             |-

However, my ImageNet directory structure was like ILSVRC2012/CLS-LOC/train/n01440764/*.JPEG (I did not use the tar file) and I wrongly specified the --imagenet_dir as ILSVRC2012/CLS-LOC.
In my case, specifying --imagenet_dir as ILSVRC2012/CLS-LOC/train is correct and worked fine.

@yaoyao-liu
Copy link
Owner

Replacing line 82 with image_path = glob(os.path.join(img_dir, split, keys, '*')) worked for me.

It turned out the code I posted above was wrong, and I am really sorry for the confusion.
In my case, the posted code worked for train dataset by accident and does not work for val and test sets of the tiered-ImageNet dataset.

The original code is correct, and the reason I had the problem was that I wrongly specified the --imagenet_dir.
It seems the ImageNet directory structure is assumed to be like this in the program:

[--imagenet_dir] --- n01440764 --- *.JPEG
                  |             |- *.JPEG
                  |
                  |
                  |- n01443537 --- *.JPEG
                  |             |-

However, my ImageNet directory structure was like ILSVRC2012/CLS-LOC/train/n01440764/*.JPEG (I did not use the tar file) and I wrongly specified the --imagenet_dir as ILSVRC2012/CLS-LOC.
In my case, specifying --imagenet_dir as ILSVRC2012/CLS-LOC/train is correct and worked fine.

Thanks all the same for your interest in our work. I'll check this repo later when I have time.

@akinaka0x
Copy link

This code is very useful, and thank you for sharing it with us!

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