File size: 2,166 Bytes
8d82201
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash
#SBATCH --job-name=lavt_mlw005-res
#SBATCH --nodes=1
#SBATCH --gres=gpu:4
#SBATCH --time=0-12:00:00  # d-hh:mm:ss, job time limit
#SBATCH --mem=75000 # cpu memory size 
#SBATCH --cpus-per-task=6 
#SBATCH --output=./logs/gref_hp05_m10_tmp005_resume.log

source ${HOME}/.bashrc
source ${HOME}/miniconda3/bin/activate base
conda activate cris 

cd /home/s1/chaeyunkim/LAVT-RIS


# gref_hp05_m10_tmp005_resume
# --metric_loss_weight 0.05 \
# sbatch ./scripts/baseline_test_lr_resume_mlw005.sh ./models/gref_hp05_m10_tmp005 gref_hp05_m10_tmp005 10 0.05 hardpos_only_refined /home/s1/chaeyunkim/LAVT-RIS/models/gref_hp05_m10_tmp005/model_best_gref_hp05_m10_tmp005.pth


#--metric_loss_weight 0.05 \
# gref_hp05_m10_tmp005_orig_resume
# sbatch ./scripts/baseline_test_lr_resume_mlw005.sh ./models/gref_hp05_m10_tmp005_orig gref_hp05_m10_tmp005_orig 10 0.05 hardpos_only /home/s1/chaeyunkim/LAVT-RIS/models/gref_hp05_m10_tmp005_orig/model_best_gref_hp05_m10_tmp005_orig.pth



export NCCL_P2P_DISABLE=1
export NVIDIA_TF32_OVERRIDE=0

# # core args
# BATCH_SIZE=64
GPUS=4
OUTPUT_DIR=$1
EXP_NAME=$2
MARGIN=$3
TEMP=$4
MODE=$5
RESUME=$6

# # Create the directory if it does not exist
# if [[ ! -d "${OPT_DIR}/${EXP_NAME}" ]]; then
#     echo "Directory ${OPT_DIR}/${EXP_NAME} does not exist. Creating it..."
#     mkdir -p "${OPT_DIR}/${EXP_NAME}"
# fi


# TRAIN
# hardpos_only, hardpos_only_rev
python_args="--model lavt_one \
--dataset refcocog \
--splitBy umd \
--output-dir ${OUTPUT_DIR} \
--model_id ${EXP_NAME} \
--batch-size 4 \
--lr 0.00005 \
--wd 1e-2 \
--swin_type base \
--pretrained_swin_weights ./pretrained_weights/swin_base_patch4_window12_384_22k.pth \
--epochs 40 \
--img_size 480 \
--metric_learning \
--margin_value ${MARGIN} \
--temperature ${TEMP} \
--resume ${RESUME} \
--metric_mode ${MODE} \
--metric_loss_weight 0.05 \
--exclude_multiobj "

python -m torch.distributed.launch --nproc_per_node=$GPUS train.py $python_args


# python test.py --model lavt_one --swin_type base --dataset refcocog --splitBy umd --split test --resume ./models/gref_umd/lavt_test_lr/gref_testlr_4gpu.pth --workers 4 --ddp_trained_weights --window12 --img_size 480