KaiyangZhou / Dassl.pytorch

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

Some trainer config files are missing #21

Closed buerzlh closed 3 years ago

buerzlh commented 3 years ago

Some trainer config files are missing Thank you very much if you can share these files, especially mean teacher.

KaiyangZhou commented 3 years ago

I don't have the config files for mean teacher (I assume you are talking about experiments in the SSL setting). It's easy to write one. Please see dassl/config/defaults.py for the setup. Feel free to post further questions here

buerzlh commented 3 years ago

How about SelfEnsembling (the mean teacher in domain adaptation)?

KaiyangZhou commented 3 years ago

For SelfEnsembling, you can keep the default parameters (see https://github.com/KaiyangZhou/Dassl.pytorch/blob/master/dassl/config/defaults.py#L205) and use these training parameters at https://github.com/KaiyangZhou/Dassl.pytorch/tree/master/configs/trainers/da/source_only.

For example, to train SelfEnsembling on Office-31, simply do

CUDA_VISIBLE_DEVICES=0 python tools/train.py \
--root $DATA \
--trainer SelfEnsembling \
--source-domains amazon \
--target-domains webcam \
--dataset-config-file configs/datasets/da/office31.yaml \
--config-file configs/trainers/da/source_only/office31.yaml \
--output-dir output/selfensembling_office31/amazon_to_webcam

If you want to build your own code on top of Dassl.pytorch, you can check this example.

buerzlh commented 3 years ago

Thanks,I found out not long ago. It is really nice works