Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to perform validation of domain generalization? #8

Open
freya-7 opened this issue Apr 8, 2024 · 1 comment
Open

How to perform validation of domain generalization? #8

freya-7 opened this issue Apr 8, 2024 · 1 comment

Comments

@freya-7
Copy link

freya-7 commented Apr 8, 2024

I have trained the model on imagenet and want to validate it on the other four variants. But I didn't find the relevant xd_test.bash file, could you provide it?

@htyao89
Copy link
Owner

htyao89 commented Apr 10, 2024

I have trained the model on imagenet and want to validate it on the other four variants. But I didn't find the relevant xd_test.bash file, could you provide it?

The saved model's path might be changed with your path (--model-dir).
"--load-epoch" is set as the epoch of training.

#!/bin/bash

cd ..

custom config

DATA=/data/yht/data/cl/data/
TRAINER=KgCoOp

CFG=vit_b16_ep100_ctxv1
SHOTS=16
WEIGHT=8.0

for DATASET in imagenetv2 imagenet_sketch imagenet_a imagenet_r
do
for SEED in 1 2 3
d
DIR=output_0122_cd/evaluation/${TRAINER}/${CFG}${SHOTS}shots/${DATASET}/seed${SEED}
if [ -d "$DIR" ]; then
echo "Oops! The results exist at ${DIR} (so skip this job)"
else
python train.py
--root ${DATA}
--seed ${SEED}
--trainer ${TRAINER}
--dataset-config-file configs/datasets/${DATASET}.yaml
--config-file configs/trainers/${TRAINER}/${CFG}.yaml
--output-dir ${DIR}
--model-dir output_0122_cd/base2new/train_base/imagenet/shots
${SHOTS}_${WEIGHT}/${TRAINER}/${CFG}/seed${SEED}
--load-epoch 25
--eval-only
TRAINER.COOP.N_CTX 4
fi
done
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants