datariengcuathuongbui / code /chain_v2.sh
ThuongBuiRVC's picture
Add files using upload-large-folder tool
cfa2024 verified
Raw History Blame Contribute Delete
1.73 kB
#!/bin/bash
# db: VLR v2 (figure "VLR Planner v2"). 1) smoke run: 16 train keyframes, 1 epoch, val on the 227 old-val keyframes
# (exercises the loop, VQA answers, planning, devkit NPS); 2) the real run from joint_r1/last.pt, 8 epochs, val_off
# NPS every epoch; 3) the submission. The GPU is held between steps (gpu_hold.py).
cd /home/db/ThuongBui/localization/vlr
ulimit -n "$(ulimit -Hn)" 2>/dev/null
PY=/home/db/miniforge3/envs/locnet/bin/python
D=/mnt/10TB_HDD/nuReasoning/vlr
hold() {
[ -f /tmp/vlr_gpu_hold.pid ] && kill -0 "$(cat /tmp/vlr_gpu_hold.pid)" 2>/dev/null && return
rm -f /tmp/vlr_gpu_held /tmp/vlr_gpu_release
nohup $PY gpu_hold.py 9000 >> gpu_hold.log 2>&1 & sleep 1
}
echo "$(date +%T) smoke"
hold
$PY vlr_s1.py --name v2_smoke --model v2 --init runs/joint_r1/last.pt --ego-fut $D/data/ego_fut_v2.pkl \
--train-split train --val-split val --limit 16 --cache $D/cache --data $D/data --epochs 1 --batch 4 --lr 1e-4 > v2_smoke.log 2>&1
hold
grep -q '^EPOCH' v2_smoke.log || { echo "smoke failed"; tail -30 v2_smoke.log; exit 1; }
grep '^EPOCH' v2_smoke.log | cut -c1-600
echo "$(date +%T) v2_r1"
$PY vlr_s1.py --name v2_r1 --model v2 --init runs/joint_r1/last.pt --ego-fut $D/data/ego_fut_v2.pkl \
--train-split train,val,train_supp --val-split val_off --cache $D/cache --data $D/data \
--epochs 8 --batch 8 --lr 1e-4 --export > v2_r1.log 2>&1
test -f runs/v2_r1/test_traj.json || { echo "v2_r1 failed"; tail -30 v2_r1.log; exit 1; }
$PY vlr_submit.py --template $D/data/submission_template.json --answers runs/v2_r1/test_answers.json \
--traj runs/v2_r1/test_traj.json --run v2_r1 --out $D/submissions/submission_vlr_v2_r1.json > submit_v2.log 2>&1
cat submit_v2.log
echo V2_DONE