Download code/chain_db4.sh from ThuongBuiRVC/datariengcuathuongbui: direct link, hf CLI and curl.
- Browser
- Download file 2.32 kB
-
https://huggingface.co/datasets/ThuongBuiRVC/datariengcuathuongbui/resolve/main/code/chain_db4.sh
- Command line
-
hf download hf://datasets/ThuongBuiRVC/datariengcuathuongbui/code/chain_db4.sh
-
curl -L -o chain_db4.sh https://huggingface.co/datasets/ThuongBuiRVC/datariengcuathuongbui/resolve/main/code/chain_db4.sh
2.32 kB
| # db overnight, after val/test are encoded: wait for the missing-camera fetch of train (pid $1), retry its failed | |
| # frames ($HF_TOKEN in the environment only), then encode train. gpu_hold.py grabs the GPU | |
| # the moment it is free (other jobs are never stopped) and keeps it between our stages; each of our GPU processes takes | |
| # it over itself right before allocating (gpu_take.take_gpu). encode -> S1 -> submission -> S2 + S3 -> submissions. | |
| cd /home/db/ThuongBui/localization/vlr | |
| PY=/home/db/miniforge3/envs/locnet/bin/python | |
| D=/mnt/10TB_HDD/nuReasoning/vlr | |
| BASE=$D/data/submission_base_G2_selA_ep05.json | |
| FETCH_PID=$1 | |
| hold() { # start a holder unless one is alive | |
| [ -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 | |
| } | |
| hold | |
| while kill -0 $FETCH_PID 2>/dev/null; do sleep 30; done | |
| [ -n "$HF_TOKEN" ] && $PY vlr_fetch_side.py --splits train --threads 16 --retry > fetch_side_retry.log 2>&1 # frames that failed | |
| unset HF_TOKEN | |
| $PY vlr_encode_local.py --splits train --min-free 9000 > encode_local_train.log 2>&1 | |
| hold | |
| grep -q ENCODE_DONE encode_local_train.log || { echo "encode train failed"; exit 1; } | |
| $PY vlr_fetch_side.py --splits val train --delete > fetch_side_delete.log 2>&1 | |
| $PY vlr_s1.py --name s1_full --cache $D/cache --data $D/data --epochs 10 --batch 8 --export > s1_full.log 2>&1 | |
| hold | |
| test -f runs/s1_full/test_answers.json || { echo "S1 failed"; exit 1; } | |
| $PY vlr_submit.py --base $BASE --answers runs/s1_full/test_answers.json --out $D/submissions/submission_vlr_s1.json > submit.log 2>&1 | |
| $PY vlr_s1.py --name s23_full --model plan --init runs/s1_full/best.pt --ego-fut $D/data/ego_fut.pkl --cache $D/cache \ | |
| --data $D/data --epochs 6 --batch 8 --lr 1e-4 --export > s23_full.log 2>&1 | |
| test -f runs/s23_full/test_traj.json || { echo "S2+S3 failed"; exit 1; } | |
| $PY vlr_submit.py --base $BASE --answers runs/s23_full/test_answers.json --out $D/submissions/submission_vlr_s2.json >> submit.log 2>&1 | |
| $PY vlr_submit.py --base $BASE --answers runs/s23_full/test_answers.json --traj runs/s23_full/test_traj.json \ | |
| --out $D/submissions/submission_vlr_s23.json >> submit.log 2>&1 | |
| echo CHAIN_DONE | |