File size: 1,949 Bytes
9ffd3e8
 
 
 
 
 
be78d6b
 
9ffd3e8
 
110cee3
 
 
6145c8e
 
 
9ffd3e8
 
 
 
 
be78d6b
110cee3
9ffd3e8
 
 
 
 
 
 
110cee3
 
9ffd3e8
 
 
 
6145c8e
 
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
#!/bin/bash
# Fine-tune SmolVLA (lerobot/smolvla_base) on the phase 2 sim dataset, overhead and wrist
# cameras only, and push the result to the Hugging Face Hub.
#
# The base model was pretrained with cameras named camera1..camera3; the rename map
# feeds our overhead view as camera1 and the wrist view as camera2 (camera3 unused).
# Starts from the base model unless BASE names a checkpoint to continue from (for example the
# baseline, to fine-tune it on correction demonstrations).
# Run from the project root on the GPU pod, after sim/make_train_view.py:
#   STEPS=20000 bash sim/train_policy.sh
# Baseline (overhead and wrist only already, no train view needed):
#   ROOT=data/so101_chess_baseline REPO=Machanize/chess_phase_smolvla_baseline \
#     JOB=chess_phase_smolvla_baseline STEPS=10000 bash sim/train_policy.sh
# EXTRA_ARGS adds lerobot-train options (for example --policy.optimizer_lr=0.0).
# Note: when BASE is a trained checkpoint, lerobot-train replaces its saved state/action
# normalization with the statistics of the dataset at ROOT (lerobot_train.py, overrides).
set -euo pipefail
cd "$(dirname "$0")/.."
ROOT=${ROOT:-data/so101_chess_sim_train}
REPO=${REPO:-Machanize/chess_phase_smolvla}
.venv/bin/lerobot-train \
  --policy.path="${BASE:-lerobot/smolvla_base}" \
  --dataset.repo_id="${DATASET_ID:-local/so101_chess_sim_train}" \
  --dataset.root="$ROOT" \
  --rename_map='{"observation.images.overhead": "observation.images.camera1", "observation.images.wrist": "observation.images.camera2"}' \
  --batch_size="${BATCH:-64}" \
  --steps="${STEPS:-20000}" \
  --save_freq="${SAVE_FREQ:-5000}" \
  --log_freq=100 \
  --num_workers="${WORKERS:-24}" \
  --output_dir="${OUT:-outputs/${JOB:-chess_phase_smolvla}}" \
  --job_name="${JOB:-chess_phase_smolvla}" \
  --policy.device=cuda \
  --wandb.enable=false \
  --policy.push_to_hub="${PUSH:-true}" \
  --policy.repo_id="$REPO" \
  --policy.private=false \
  ${EXTRA_ARGS:-}