KaiyangZhou / Dassl.pytorch

A PyTorch toolbox for domain generalization, domain adaptation and semi-supervised learning.
MIT License
1.23k stars 171 forks source link

i can't run mixmatch.py #29

Closed judgingalready closed 3 years ago

judgingalready commented 3 years ago

There is only fixmatch fold in 'Dassl.pytorch/configs/trainers/ssl/' when i choose 'fixmatch/cifar10.yaml' as config-file and run this:

_CUDA_VISIBLEDEVICES=2 python tools/train.py --root 'ssl/data/' --trainer MixMatch --dataset-config-file configs/datasets/ssl/cifar10.yaml --config-file configs/trainers/ssl/fixmatch/cifar10.yaml --output-dir output/mixmatch

and get this: assert cfg.DATALOADER.K_TRANSFORMS > 1 (because cfg.DATALOADER.K_TRANSFORMS==1 in default)

so could you give a mixmatch config-file? Thanks a lot :)

KaiyangZhou commented 3 years ago

MixMatch loads images that are augmented into different views, so it requires K_TRANSFORMS >1. See this code for more details.

For MixMatch's hyperparameters, you can simply use the default settings.

You can simply add DATALOADER.K_TRANSFORMS 2 to the argument list when running train.py.

judgingalready commented 3 years ago

Thx! it works :)