floodsung / LearningToCompare_FSL

PyTorch code for CVPR 2018 paper: Learning to Compare: Relation Network for Few-Shot Learning (Few-Shot Learning part)
MIT License
1.04k stars 268 forks source link

sample larger than population" #39

Closed mkhfring closed 3 years ago

mkhfring commented 3 years ago

I am trying to run the following command:

python miniimagenet_train_one_shot.py -w 5 -s 1 -b 15

However, I get the following error:

Traceback (most recent call last):
  File "miniimagenet_train_one_shot.py", line 269, in <module>
    main()
  File "miniimagenet_train_one_shot.py", line 169, in main
    task = tg.MiniImagenetTask(metatrain_folders,CLASS_NUM,SAMPLE_NUM_PER_CLASS,BATCH_NUM_PER_CLASS)
  File "/content/gdrive1/My Drive/learn_to_learn/LearningToCompare_FSL/miniimagenet/task_generator.py", line 55, in __init__
    class_folders = random.sample(self.character_folders,self.num_classes)
  File "/usr/lib/python2.7/random.py", line 325, in sample
    raise ValueError("sample larger than population")
ValueError: sample larger than population

Can any one help me with this issue please?