-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrain_lp_vgg_nc.sh
More file actions
executable file
·43 lines (41 loc) · 1.31 KB
/
Copy pathtrain_lp_vgg_nc.sh
File metadata and controls
executable file
·43 lines (41 loc) · 1.31 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
37
38
39
40
41
42
43
#!/bin/bash
### VGG Linear Probing
## Specify 'vgg17' in arch
# Specify input resolution as 224 in INPUT
# Specify ood dataset names in SET
BS=256 # batch size
EPOCH=30 # Num of epochs to train linear probes
GPU=0,1,2,3 # gpu
SAVE_DIR=./lp_results_vgg_oodg
DATA_DIR=./data/ # Path to OOD Datasets
INPUT=224 # Input Image Resolution
NUM_CLS=100 # Num of Classes in ID Dataset (ImageNet-100)
### Linear Probing (VGG17 + ETF Projector + Entropy Reg)
for SET in imagenet_r200 CIFAR100 Flower102 ninco CUB200 Aircrafts Pet Stl
do
EXPT_NAME=LP_VGG17_IN_${NUM_CLS}c_etf_proj_ent_reg_${SET}
FEAT_DIR=./features/${SET} # For Storing Extracted Features
CKPT_DIR=/home/yousuf/code_nc_icml/vgg/pretrained_vgg17
CKPT=best_VGG17_IN_${NUM_CLS}c_etf_proj_ent_reg_${NUM_CLS}.pth
CUDA_VISIBLE_DEVICES=${GPU} python -u main_vgg.py \
--expt_name ${EXPT_NAME} \
--task lin_probe \
--no_wandb 0 \
--nc_control 1 \
--data_dir ${DATA_DIR} \
--save_dir ${SAVE_DIR} \
--set ${SET} \
--input_size ${INPUT} \
--seed 0 \
--arch 'vgg17' \
--ckpt_root ${CKPT_DIR} \
--ckpt_paths ${CKPT} \
--ckpt_info ${EXPT_NAME} \
--lr 0.001 \
--weight_decay 0 \
--epochs ${EPOCH} \
--batch_size ${BS} \
--extract_features 1 \
--features_per_file 20000 \
--features_root ${FEAT_DIR}
done