File size: 2,325 Bytes
cfa2024
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash
# db overnight: encode the latents (cameras absent on disk are recorded and masked), train S1, build its submission,
# then train S2 + S3 from S1 and build their submissions. Every GPU step first waits for >= 10 GB free (never stops
# other jobs). With $HF_TOKEN set (environment only) the frames of the cameras missing on disk are fetched first and
# deleted again after encoding.
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
wait_gpu() { $PY -c "import sys; sys.path.insert(0, '.'); from vlr_encode_local import wait_gpu; wait_gpu(10000)"; }

if [ -n "$HF_TOKEN" ]; then                     # frames of the cameras missing on disk, from the HF tars
    $PY vlr_fetch_side.py --splits val > fetch_side_val.log 2>&1
    $PY vlr_fetch_side.py --splits train > fetch_side_train.log 2>&1 &
    FETCH=$!
fi
$PY vlr_encode_local.py --splits val test > encode_local.log 2>&1
grep -q ENCODE_DONE encode_local.log || { echo "encode val/test failed"; exit 1; }
[ -n "$FETCH" ] && wait $FETCH
$PY vlr_encode_local.py --splits train > encode_local_train.log 2>&1
grep -q ENCODE_DONE encode_local_train.log || { echo "encode train failed"; exit 1; }
[ -n "$HF_TOKEN" ] && $PY vlr_fetch_side.py --splits val train --delete > fetch_side_delete.log 2>&1
unset HF_TOKEN

wait_gpu
$PY vlr_s1.py --name s1_full --cache $D/cache --data $D/data --epochs 10 --batch 8 --export > s1_full.log 2>&1
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

wait_gpu
$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