muzairkhattak / multimodal-prompt-learning

[CVPR 2023] Official repository of paper titled "MaPLe: Multi-modal Prompt Learning".
https://muzairkhattak.github.io/multimodal-prompt-learning/
MIT License
619 stars 43 forks source link

There may be bugs in preprocess ImageNet? #22

Closed Rainlt closed 1 year ago

Rainlt commented 1 year ago

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.

Rainlt commented 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.