-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain_vqa.sh
176 lines (170 loc) · 6.31 KB
/
train_vqa.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/bin/bash
#SBATCH --job-name=vqa
#SBATCH --output=runs/vqa-log-%J.txt
#SBATCH --ntasks=8
#SBATCH --time=1-20:00:00
#SBATCH --mem=50G
#SBATCH -N 1
#SBATCH --gres=gpu:a100:1
#SBATCH --partition=a100
#SBATCH --qos=a100_bowang
source /h/junma/.mllm/bin/activate
# run "accelerate config" first!
JOB_ID=$SLURM_JOB_ID
# PYTHONPATH=. accelerate launch --num_processes 1 --main_process_port 29510 LaMed/src/train/amos_train.py \
# --version v0 \
# --model_name_or_path microsoft/Phi-3-mini-4k-instruct \
# --cache_dir /scratch/ssd004/datasets/med-img-data/amosmm/LaMed/ \
# --model_type phi3 \
# --lora_enable True \
# --freeze_llm False \
# --lora_r 16 \
# --vision_tower vit3d \
# --pretrain_vision_model /scratch/ssd004/datasets/med-img-data/amosmm/LaMed/M3D-CLIP/pretrained_ViT.bin \
# --bf16 True \
# --output_dir /scratch/ssd004/datasets/med-img-data/amosmm/trained/paper/phi3_vqa_withgen \
# --num_train_epochs 100 \
# --per_device_train_batch_size 4 \
# --per_device_eval_batch_size 1 \
# --gradient_accumulation_steps 1 \
# --evaluation_strategy "no" \
# --do_eval False \
# --eval_accumulation_steps 1 \
# --eval_steps 0.99 \
# --save_strategy "steps" \
# --save_steps 200000 \
# --save_total_limit 1 \
# --learning_rate 5e-5 \
# --weight_decay 0. \
# --warmup_ratio 0.03 \
# --lr_scheduler_type "cosine" \
# --logging_steps 0.001 \
# --gradient_checkpointing False \
# --dataloader_pin_memory True\
# --dataloader_num_workers 4 \
# --report_to none \
# --task vqa \
# --json_path /fs01/home/junma/MedicalVLM/Data/AMOSMM.json \
# --data_root /scratch/ssd004/datasets/med-img-data/amosmm \
# --image_size "32, 256, 256" \
# --with_gen True \
# --with_template True \
# --model_max_length 760
# PYTHONPATH=. accelerate launch --num_processes 4 --main_process_port 29502 LaMed/src/train/amos_train.py \
# --version v0 \
# --model_name_or_path microsoft/Phi-3-mini-4k-instruct \
# --cache_dir /scratch/ssd004/datasets/med-img-data/amosmm/LaMed/ \
# --model_type phi3 \
# --lora_enable True \
# --freeze_llm False \
# --lora_r 16 \
# --vision_tower vit3d \
# --pretrain_vision_model /scratch/ssd004/datasets/med-img-data/amosmm/LaMed/M3D-CLIP/pretrained_ViT.bin \
# --bf16 True \
# --output_dir /scratch/ssd004/datasets/med-img-data/amosmm/trained/paper/phi3_vqa_anyres \
# --num_train_epochs 100 \
# --per_device_train_batch_size 1 \
# --per_device_eval_batch_size 1 \
# --gradient_accumulation_steps 1 \
# --evaluation_strategy "no" \
# --do_eval False \
# --eval_accumulation_steps 1 \
# --eval_steps 0.99 \
# --save_strategy "steps" \
# --save_steps 200000 \
# --save_total_limit 1 \
# --learning_rate 5e-5 \
# --weight_decay 0. \
# --warmup_ratio 0.03 \
# --lr_scheduler_type "cosine" \
# --logging_steps 0.001 \
# --gradient_checkpointing False \
# --dataloader_pin_memory True\
# --dataloader_num_workers 4 \
# --report_to none \
# --task vqa \
# --json_path /fs01/home/junma/MedicalVLM/Data/AMOSMM.json \
# --data_root /scratch/ssd004/datasets/med-img-data/amosmm \
# --image_size "32, 256, 256" \
# --any_res_crops "[(2, 2, 2)]" \
# --any_res_image_size "64, 512, 512" \
# --with_gen False \
# --with_template True \
# --model_max_length 2540
# PYTHONPATH=. accelerate launch --num_processes 1 --main_process_port 29535 LaMed/src/train/amos_train.py \
# --version v0 \
# --model_name_or_path /scratch/ssd004/datasets/med-img-data/amosmm/LaMed/M3D-LaMed-Phi-3-4B \
# --cache_dir /scratch/ssd004/datasets/med-img-data/amosmm/LaMed/ \
# --model_type phi3 \
# --lora_enable True \
# --freeze_llm False \
# --lora_r 16 \
# --vision_tower vit3d \
# --pretrain_vision_model /scratch/ssd004/datasets/med-img-data/amosmm/LaMed/M3D-CLIP/pretrained_ViT.bin \
# --bf16 True \
# --output_dir /scratch/ssd004/datasets/med-img-data/amosmm/trained/paper/phi3m3d_vqa \
# --num_train_epochs 100 \
# --per_device_train_batch_size 4 \
# --per_device_eval_batch_size 1 \
# --gradient_accumulation_steps 1 \
# --evaluation_strategy "no" \
# --do_eval False \
# --eval_accumulation_steps 1 \
# --eval_steps 0.99 \
# --save_strategy "steps" \
# --save_steps 200000 \
# --save_total_limit 1 \
# --learning_rate 5e-5 \
# --weight_decay 0. \
# --warmup_ratio 0.03 \
# --lr_scheduler_type "cosine" \
# --logging_steps 0.001 \
# --gradient_checkpointing False \
# --dataloader_pin_memory True\
# --dataloader_num_workers 4 \
# --report_to none \
# --task vqa \
# --json_path /fs01/home/junma/MedicalVLM/Data/AMOSMM.json \
# --data_root /scratch/ssd004/datasets/med-img-data/amosmm \
# --image_size "32, 256, 256" \
# --with_gen False \
# --with_template False \
# --model_max_length 512
PYTHONPATH=. accelerate launch --num_processes 1 --main_process_port 29525 LaMed/src/train/amos_train.py \
--version v0 \
--model_name_or_path microsoft/Phi-3-mini-4k-instruct \
--cache_dir /scratch/ssd004/datasets/med-img-data/amosmm/LaMed/ \
--model_type phi3 \
--lora_enable True \
--freeze_llm False \
--lora_r 16 \
--pretrain_vision_model /scratch/ssd004/datasets/med-img-data/amosmm/LaMed/M3D-CLIP/pretrained_ViT.bin \
--bf16 True \
--output_dir /scratch/ssd004/datasets/med-img-data/amosmm/trained/paper/phi3_vqa_tt \
--num_train_epochs 100 \
--per_device_train_batch_size 4 \
--per_device_eval_batch_size 1 \
--gradient_accumulation_steps 1 \
--evaluation_strategy "no" \
--do_eval False \
--eval_accumulation_steps 1 \
--eval_steps 0.99 \
--save_strategy "steps" \
--save_steps 200000 \
--save_total_limit 1 \
--learning_rate 5e-5 \
--weight_decay 0. \
--warmup_ratio 0.03 \
--lr_scheduler_type "cosine" \
--logging_steps 0.001 \
--gradient_checkpointing False \
--dataloader_pin_memory True\
--dataloader_num_workers 4 \
--report_to none \
--task vqa \
--json_path /fs01/home/junma/MedicalVLM/Data/AMOSMM.json \
--data_root /scratch/ssd004/datasets/med-img-data/amosmm \
--image_size "32, 256, 256" \
--with_gen False \
--with_template True \
--model_max_length 512