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
ImageNet dataset cannot be loaded #2
Comments
Hi HigasaOR, Thank you for your interest in our work! Please set --test_dir to 'ImageNet/val' directory, where 'val' contains sub-folders (classes) of ImageNet validation set. Cheers, |
Hi, Thanks for replying! This is exactly what I have done: Thanks |
Hi HigasaOR, I checked again and the code is working fine. Can you please post what error you are facing while loading? Muzammal |
Thanks |
As this cannot be reproduced on every machine, I'll just close this issue. At least the code works with little modification I mentioned in my situation. Thanks for your help. |
I tested the code (
run_attack.sh
) and found that I cannot load imagenet dataset. I dug into it and found that maybe its because indataset.py
, in class AdvImageNet:self.image_list is a set loaded with the predifined
data/image_list.json
, so an element string in it looks like this:n01820546/ILSVRC2012_val_00027008.JPEG
Nonetheless, the
is_valid_file
function used in super init keeps only the last 38 char of the image file path, likeILSVRC2012_val_00027008.JPEG
, to check if it's listed in self.image_list. Thus, the function will always return false as there is no class folder in the string, and no image will be loaded.
A simple workaround will work (at least I've tested):
Another possibility is that the imagenet structure used by this repo is different from mine:
In this case, could you specify how the dataset should be structured? Thank you!
The text was updated successfully, but these errors were encountered: