-
Notifications
You must be signed in to change notification settings - Fork 64
/
vit_g_k710_it_k600_ft.sh
57 lines (53 loc) · 1.61 KB
/
vit_g_k710_it_k600_ft.sh
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
set -x
export MASTER_PORT=$((12000 + $RANDOM % 20000))
export OMP_NUM_THREADS=1
OUTPUT_DIR='YOUR_PATH/work_dir/vit_g_hybrid_pt_1200e_k710_it_k600_ft'
DATA_PATH='YOUR_PATH/data/k600'
MODEL_PATH='YOUR_PATH/model_zoo/vit_g_hybrid_pt_1200e_k710_ft.pth'
JOB_NAME=$1
PARTITION=${PARTITION:-"video"}
# 8 for 1 node, 16 for 2 node, etc.
GPUS=${GPUS:-32}
GPUS_PER_NODE=${GPUS_PER_NODE:-8}
CPUS_PER_TASK=${CPUS_PER_TASK:-10}
SRUN_ARGS=${SRUN_ARGS:-""}
PY_ARGS=${@:2}
# batch_size can be adjusted according to the graphics card
srun -p $PARTITION \
--job-name=${JOB_NAME} \
--gres=gpu:${GPUS_PER_NODE} \
--ntasks=${GPUS} \
--ntasks-per-node=${GPUS_PER_NODE} \
--cpus-per-task=${CPUS_PER_TASK} \
--kill-on-bad-exit=1 \
--async \
${SRUN_ARGS} \
python run_class_finetuning.py \
--model vit_giant_patch14_224 \
--data_set Kinetics-600 \
--nb_classes 600 \
--data_path ${DATA_PATH} \
--finetune ${MODEL_PATH} \
--log_dir ${OUTPUT_DIR} \
--output_dir ${OUTPUT_DIR} \
--batch_size 3 \
--input_size 224 \
--short_side_size 224 \
--save_ckpt_freq 10 \
--num_frames 16 \
--sampling_rate 4 \
--num_sample 2 \
--num_workers 10 \
--opt adamw \
--lr 1e-5 \
--drop_path 0.25 \
--layer_decay 0.9 \
--opt_betas 0.9 0.999 \
--weight_decay 0.1 \
--warmup_epochs 1 \
--epochs 3 \
--test_num_segment 5 \
--test_num_crop 3 \
--dist_eval --enable_deepspeed \
${PY_ARGS}