File size: 1,652 Bytes
9fe982a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash
# [OFFLINE fallback] Evaluate using precomputed *_offline visual tokens.
# This is NOT the default. Use scripts/eval_checkpoint.sh for online mode.
# Isolated by default. Set ATLAS_ALLOW_OFFLINE=1 to run.
set -e

if [ "${ATLAS_ALLOW_OFFLINE}" != "1" ]; then
    echo "ERROR: This is an OFFLINE fallback script, not the primary online evaluation." >&2
    echo "It is isolated by default to prevent accidental use in experiments." >&2
    echo "If you really need it, set:  ATLAS_ALLOW_OFFLINE=1" >&2
    echo "For production evaluation use:  bash scripts/eval_checkpoint.sh" >&2
    exit 1
fi

PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$PROJECT_ROOT"

CHECKPOINT="${1:?Usage: $0 <checkpoint> <data_json> [output_json] [max_samples]}"
DATA_JSON="${2:?Usage: $0 <checkpoint> <data_json> [output_json] [max_samples]}"
OUTPUT_JSON="${3:-}"
MAX_SAMPLES="${4:-0}"
PLANNING_TABLE3_MODE="${PLANNING_TABLE3_MODE:-atlas_base}"

EXTRA_ARGS=""
if [ -n "$OUTPUT_JSON" ]; then
    EXTRA_ARGS="$EXTRA_ARGS --output_json $OUTPUT_JSON"
fi
if [ "$MAX_SAMPLES" -gt 0 ] 2>/dev/null; then
    EXTRA_ARGS="$EXTRA_ARGS --max_samples $MAX_SAMPLES"
fi

python eval_atlas.py \
    --checkpoint "$CHECKPOINT" \
    --llm_model pretrained/vicuna-7b-v1.5 \
    --data_json "$DATA_JSON" \
    --data_root /home/guoyuanbo/autodl-tmp/data/nuscenes \
    --visual_token_mode offline \
    --planning_table3_mode "$PLANNING_TABLE3_MODE" \
    --precomputed_det_tokens work_dirs/precomputed_det_tokens_offline/val \
    --precomputed_map_tokens work_dirs/precomputed_map_tokens_offline/val \
    --bf16 \
    --batch_size 1 \
    --num_workers 2 \
    $EXTRA_ARGS