dmcdono7's picture
model card + handoff
bd86408 verified
|
Raw History Blame Contribute Delete
6.28 kB
# BEST2 — best real-arm block-stacking ACT policy (start here)
act_stack_v3_dag60k_r2 step 10000: 60k base + 10k-step fine-tune on 50 demos + 72 round-1 + 32 round-2 DAgger corrections. Run with temporal ensembling (n_action_steps=1, temporal_ensemble_coeff=0.01), 90 s episodes. Training data: dataset hrl-imerse/doug-stack-v3-best2-train.
# Block stacking: BEST2 is the policy to build on (handoff, 2026-11-18)
**For Michelle (and her Claude): start every new stacking experiment from BEST2.** It is the best real-arm
stacking policy we have. Don't retrain from scratch or from the 60k base: round 3 below did that and got
worse on the arm even though its val loss was the lowest.
## What to download
| What | Hugging Face | Local (Doug's laptop) |
|---|---|---|
| **BEST2 policy** (start here) | model `hrl-imerse/doug-act-stack-best2` | `task2_v3/outputs/BEST2_stack_dag60k_r2_10k/pretrained_model` (read-only) |
| BEST2's exact training set | dataset `hrl-imerse/doug-stack-v3-best2-train` (154 eps: 72 r1 + 32 r2 corrections, then the 50 demos) | `task2_v3/data/so101_block_stack_v3_dag60k_r2` |
| Original 50 teleop demos | dataset `hrl-imerse/doug-stack-v3-trimmed` | `task2_v3/data/so101_block_stack_v3_trimmed` |
| DAgger corrections (raw, with `intervention` column) | datasets `hrl-imerse/doug-stack-dagger-r1`, `-r2`, `-r3` | `task2_v3/data/rollout_dagger_stack60k`, `rollout_dagger_stack_dag60k10k`, `rollout_dagger_stack_r2_10k` |
| BEST (round 1, previous best) | model `hrl-imerse/doug-act-stack-best1` | `task2_v3/outputs/BEST_stack_dag60k_10k` |
Task string: `Stack the orange, green and purple blocks into a tower.` Features: `observation.state` (6),
`action` (6, absolute joint targets in degrees + gripper 0-100), `observation.images.wrist` (480x640x3, 30 fps).
Wrist camera only. Stacking order is always red/orange -> green -> purple; the three blocks start in a line of
three slots right of the tray (far/middle/near) with colours shuffled.
## How BEST2 was made
1. `act_stack_v3` (ACT, chunk 100, batch 8, image aug on) trained 100k steps on the 50 trimmed demos; **60k**
was the best real-arm checkpoint (val loss 0.2375).
2. **DAgger round 1** on 60k: 72 corrections (grasps, wrong block). Fine-tune **from 60k**, 10k steps on
[72 corrections + 50 demos], each once -> `act_stack_v3_dag60k` 10k = **BEST** (val 0.2275). On the arm: grabbed
all 3 blocks, stacked green, but held blocks on the stack 20-40 s without opening.
3. **DAgger round 2** on BEST: 32 short release corrections (open + lift ~0.5-1 s after the block lands).
Fine-tune **from 60k**, 10k steps on [72 r1 + 32 r2 + 50 demos] -> `act_stack_v3_dag60k_r2` 10k = **BEST2**
(val 0.2295). On the arm: releases after 0.6-0.8 s like the demos; "almost perfect, but not quite".
4. DAgger round 3 on BEST2: 24 corrections. Retrained **from 60k** on r1+r2+r3+demos -> val 0.2251 (lowest), but
**clearly worse on the arm**. Kept only for reference (`doug-stack-dagger-r3`).
Fine-tune recipe (task2_v3, ~10 min on an RTX 3500 Ada laptop, ~17 steps/s):
```bash
../sim/.venv/bin/python train_fast.py \
--policy.path=<BEST2 pretrained_model> \
--policy.device=cuda --policy.push_to_hub=false \
--dataset.repo_id=local/<merged> --dataset.root=$PWD/data/<merged> \
--dataset.eval_split=<5/n_episodes, so the last 5 episodes = held-out demos> --eval_steps=2500 \
--dataset.image_transforms.enable=true --accelerator.mixed_precision=bf16 \
--batch_size=8 --steps=5000 --save_freq=1000 --seed=1000 \
--output_dir=$PWD/outputs/train/<run> --job_name=<run> --trackio.enable=false
```
`train_fast.py` = lerobot-train with `torch.compile` on the ACT model (needs the `__main__` guard, it has one).
Merge datasets with `lerobot.datasets.dataset_tools.merge_datasets`, after `remove_feature(..., "intervention")`
on DAgger data; put the 50 demos LAST so the val split is the same 5 held-out demos every time.
## Adding sim data to BEST2 (Michelle's plan)
- Start from BEST2 (`--policy.path`), not from scratch: fine-tune briefly (2.5-5k steps, save every 1k).
- Keep all of BEST2's real data in the mix (`doug-stack-v3-best2-train`) so it doesn't forget; add the sim
episodes on top. Sim frames must match the real format: 640x480 wrist view with the real lens distortion,
same state/action units and joint order, same task string. Antony's sim (`assignment2/sim`, `--task stack`)
writes this format.
- The normalizer stats come from BEST2's checkpoint. If sim data shifts the state/action ranges a lot, check
`policy_preprocessor_step_3_normalizer_processor.safetensors` before trusting results.
- **Judge on the real arm, not val loss.** Run against BEST2 under the same conditions.
## Running a policy on the arm
```bash
cd assignment2/task2_v3
../sim/.venv/bin/python go_home.py 5 # ALWAYS first: slow move to the folded rest pose
EPISODE_S=90 ./3_eval_rollouts.sh <variant> <pretrained_model dir> ens 1
```
- Ensembling (`ens`, coeff 0.01) for every stacking checkpoint. 90 s episode limit.
- Keys: -> ends and saves, <- discards and redoes. LeRobot's key listener is **global**: typing anywhere (even in a
chat window) presses its keys and ends/discards trials.
- Check the wrist camera isn't black first (a blocked lens made several trials run blind).
DAgger collection: `./dagger_loop.sh <name> <pretrained_model dir>` (home -> RIGHT ARROW starts a tower ->
SPACE pause, TAB start/end a correction with the leader arm, ESC end tower -> home; Q quits). Corrections append
to `data/rollout_dagger_<name>`. Leader calibration id `so_leader`. If a USB glitch kills a tower, the loop goes
home and waits for RIGHT ARROW again.
## Lessons
- DAgger rounds 1 and 2 helped; each targeted one failure (block choice/grasp, then release).
- Round 3 hurt. Retraining from 60k each round adds run-to-run variance. Next time fine-tune from the current
best (BEST2) for a few thousand steps instead, and keep each round's corrections focused on one failure.
- Val loss on the 5 held-out demos does not predict arm success here (round 3 had the lowest).
- Release failures came from the arm stopping on the stack ~2-4 deg short of the commanded elbow angle; the
policy waited for a state it never reached. Short "open + lift" corrections fixed it.