-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain.sh
92 lines (89 loc) · 3.2 KB
/
train.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
#!/bin/bash
#SBATCH --job-name=run
#SBATCH --output=runs/run-log-%J.txt
#SBATCH --ntasks=10
#SBATCH -N 1
#SBATCH --time=1-12:00:00
#SBATCH --mem=40GB
#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 2 --main_process_port 29500 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 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_150_splitted \
# --num_train_epochs 150 \
# --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 20000 \
# --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 \
# --prompt "simple" \
# --task mrg \
# --json_path /fs01/home/junma/MedicalVLM/Data/AMOSMM.json \
# --data_root /scratch/ssd004/datasets/med-img-data/amosmm \
# --with_template True \
# --image_size "32, 256, 256" \
# --model_max_length 768
PYTHONPATH=. accelerate launch --num_processes 1 --main_process_port 29500 LaMed/src/train/amos_train.py \
--version v0 \
--model_name_or_path Qwen/Qwen2.5-VL-3B-Instruct \
--cache_dir /checkpoint/datasets.damaged/med-img-data/amosmm/LaMed/ \
--model_type qwen_3b \
--lora_enable True \
--lora_r 16 \
--vision_tower vit3d \
--pretrain_vision_model /checkpoint/datasets.damaged/med-img-data/amosmm/LaMed/M3D-CLIP/pretrained_ViT.bin \
--bf16 True \
--output_dir /checkpoint/datasets.damaged/med-img-data/amosmm/trained/paper/qwen_3b_a100 \
--num_train_epochs 150 \
--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 20000 \
--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 \
--prompt "simple" \
--task mrg \
--json_path /fs01/home/junma/MedicalVLM/Data/AMOSMM_corr.json \
--data_root /checkpoint/datasets.damaged/med-img-data/amosmm \
--with_template True \
--image_size "32, 256, 256" \
--model_max_length 768