-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
36 lines (27 loc) · 1.7 KB
/
run.sh
File metadata and controls
36 lines (27 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
export CUDA_VISIBLE_DEVICES=0
IMAGENET_PATH=Set your path here
IMAGENET_TRAIN_PATH=Set your path here
IMAGENET_VAL_PATH=Set your path here
IPC=10
# Datasets including: imagenet-woof (N_CLASS=10), imagenet-nette (N_CLASS=10), imagenet-100 (N_CLASS=100), imagenet-1k (N_CLASS=1000)
SPEC=imagenet1k
N_CLASS=1000
# run sample generation
python sample_imagenet.py --model DiT-XL/2 --arch-name "resnet18" --image-size 256 --ipc $IPC --save-dir results/$SPEC_$IPC --spec $SPEC --nclass $N_CLASS
# run evaluation: the following is for RDED evaluation process, which reproduces the paper results
# Evaluation model type: resnet18, resnet50, resnet101
python main_validate.py --subset "$SPEC" --arch-name "resnet18" --factor 2 \
--num-crop 5 --mipc 300 --ipc $IPC --stud-name "resnet18" --re-epochs 300 \
--train-dir $IMAGENET_TRAIN_PATH --val-dir $IMAGENET_VAL_PATH --repeat 3 \
--syn-data-path results/$SPEC_$IPC
python main_validate.py --subset "$SPEC" --arch-name "resnet18" --factor 2 \
--num-crop 5 --mipc 300 --ipc $IPC --stud-name "resnet50" --re-epochs 300 \
--train-dir $IMAGENET_TRAIN_PATH --val-dir $IMAGENET_VAL_PATH --repeat 3 \
--syn-data-path results/$SPEC_$IPC
python main_validate.py --subset "$SPEC" --arch-name "resnet18" --factor 2 \
--num-crop 5 --mipc 300 --ipc $IPC --stud-name "resnet101" --re-epochs 300 \
--train-dir $IMAGENET_TRAIN_PATH --val-dir $IMAGENET_VAL_PATH --repeat 3 \
--syn-data-path results/$SPEC_$IPC
# Regular evaluation, this example evaluates on resnet18
python eval.py -d imagenet --imagenet_dir results/$SPEC_$IPC $IMAGENET_PATH \
-n resnet --depth 18 --nclass $N_CLASS --norm_type instance --ipc $IPC --tag test --slct_type random --spec $SPEC --repeat 3