Closed Rainlt closed 1 year ago
It seems that we should first organize all the pictures into folders by category. Here is the script 'wget -qO- https://raw.githubusercontent.com/soumith/imagenetloader.torch/master/valprep.sh | bash'. Now it runs OK.
As we know, the val set of ImageNet has no folders. There are just some images in the 'imagenet/val'. So when we preprocess the val set 'test = self.read_data(classnames, "val")' in './datasets/imagenet.py' line 35, the folders will be empty as 'folders = sorted(f.name for f in os.scandir(split_dir) if f.is_dir())' in line 80 of 'imagenet.py' . Next, the empty 'folders' will be enumerate to get the image items, making the 'items' still an empty list.