clovaai / wsolevaluation

Evaluating Weakly Supervised Object Localization Methods Right (CVPR 2020)
MIT License
332 stars 55 forks source link

Some issue about the CUB val dataset #25

Closed DLyzhou closed 4 years ago

DLyzhou commented 4 years ago

Thanks for your work.

When I follow the guidance to run the code on CUB, the error says:

sampled_indices = np.random.choice( indices, self.num_sample_per_class, replace=False)
........
........
File "mtrand.pyx", line 946, in numpy.random.mtrand.RandomState.choice
ValueError: Cannot take a larger sample than population when 'replace=False'

Looking back to the config.py, the recommended setting is 'args.num_val_sample_per_class<=5' for CUB.

def check_dependency(args):

if args.dataset_name == 'CUB':

if args.num_val_sample_per_class >= 6:

raise ValueError("num-val-sample must be <= 5 for CUB.")

if args.dataset_name == 'OpenImages':

if args.num_val_sample_per_class >= 26:

raise ValueError("num-val-sample must be <= 25 for OpenImages.")

However, the bird category '059.California_Gull' only contains 3 images for validation while '002.Laysan_Albatross' and '007.Parakeet_Auklet' contains 6 images each. So this leads to the error above.

The solution is to expand the 059.California_Gull number from 3 to 5, or change the recommended num_val_sample_per_class=3. Feel strange there is no one meet with this problem before. :+1:

coallaoh commented 4 years ago

(From https://github.com/clovaai/wsolevaluation/issues/7)

Try

--num_val_sample_per_class 0

Some CUBV2 classes have less than 5 samples per class.

DLyzhou commented 4 years ago

Really quick response!

Yes, the num_val_sample_per_class 0 to 3 is doable. :smile: