kekmodel / MPL-pytorch

Unofficial PyTorch implementation of "Meta Pseudo Labels"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError: 'a' cannot be empty unless no samples are taken

javierrodenas opened this issue · comments

Hello,

I am trying to run the code using CIFAR10, CIFAR100 datasets and I got the following error:

Traceback (most recent call last): File "main.py", line 620, in <module> main() File "main.py", line 467, in main labeled_dataset, unlabeled_dataset, test_dataset = DATASET_GETTERS[args.dataset](args) File "/media/HDD_4TB_1/javi/MPL-pytorch/data.py", line 72, in get_cifar100 train_labeled_idxs, train_unlabeled_idxs = x_u_split(args, base_dataset.targets) File "/media/HDD_4TB_1/javi/MPL-pytorch/data.py", line 98, in x_u_split idx = np.random.choice(idx, label_per_class, False) File "mtrand.pyx", line 773, in numpy.random.mtrand.RandomState.choice ValueError: 'a' cannot be empty unless no samples are taken

How I ran the code:
python3 main.py --seed 5 --name cifar10-4K.5 --expand-labels --dataset cifar100 --num-classes 1000 --num-labeled 50000 --total-steps 300000 --eval-step 1000 --randaug 2 16 --batch-size 128 --teacher_lr 0.05 --student_lr 0.05 --weight-decay 5e-4 --ema 0.995 --nesterov --mu 7 --label-smoothing 0.15 --temperature 0.7 --threshold 0.6 --lambda-u 8 --warmup-steps 5000 --uda-steps 5000 --student-wait-steps 3000 --teacher-dropout 0.2 --student-dropout 0.2 --am

Any idea?

Thank you in advance!!