Atlas-online / scripts /train_with_caption_balanced.sh
guoyb0's picture
Add files using upload-large-folder tool
9fe982a verified
#!/bin/bash
# Atlas online training: detection + planning + lane + caption.
# Default: visual_token_mode=online, live frozen StreamPETR + TopoMLP.
# Data: 28k det + 24k plan + 28k lane + 169k caption = ~249k samples/epoch
# WARNING: caption data is 6x larger than other tasks — consider downsampling.
#
# Usage:
# bash scripts/train_with_caption_balanced.sh
# RESUME_CKPT=work_dirs/atlas_with_caption/epoch-4/checkpoint.pt bash scripts/train_with_caption_balanced.sh
# NUM_GPUS=8 bash scripts/train_with_caption_balanced.sh
set -e
PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$PROJECT_ROOT"
NUM_GPUS=${NUM_GPUS:-4}
PLANNING_TABLE3_MODE=${PLANNING_TABLE3_MODE:-atlas_high_level_ego}
EXTRA_ARGS=""
if [ -n "$RESUME_CKPT" ]; then
EXTRA_ARGS="--resume $RESUME_CKPT"
fi
deepspeed --num_gpus "$NUM_GPUS" train_atlas.py \
--llm_model pretrained/vicuna-7b-v1.5 \
--data_json data/atlas_nuscenes_train.json,data/atlas_planning_train_uniad_command.json,data/openlane_subsetB_lane_train_4pt.json,data/atlas_caption_train.json \
--data_root /home/guoyuanbo/autodl-tmp/data/nuscenes \
--visual_token_mode online \
--planning_table3_mode "$PLANNING_TABLE3_MODE" \
--streampetr_config configs/streampetr_atlas_aligned.py \
--streampetr_ckpt pretrained/streampetr/streampetr_eva02_ep24.pth \
--topomlp_config configs/topomlp_atlas_aligned.py \
--topomlp_ckpt work_dirs/topomlp_atlas_aligned/epoch_24.pth \
--deepspeed configs/ds_zero2.json \
--output_dir work_dirs/atlas_with_caption_online \
--epochs 8 \
--lr 2e-5 \
--weight_decay 1e-4 \
--batch_size 1 \
--gradient_accumulation_steps 2 \
--warmup_ratio 0.03 \
--max_grad_norm 1.0 \
--log_steps 100 \
--save_epochs 1 \
--keep_last_n_ckpts 3 \
--seed 42 \
--num_workers 4 \
$EXTRA_ARGS