gr00t-real / scripts /README.md
yqi19's picture
Upload folder using huggingface_hub
7bc9523 verified
|
Raw History Blame Contribute Delete
4.97 kB
# GR00T N1.7 Real-Robot Finetune
Fine-tuning NVIDIA GR00T-N1.7-3B on two real-robot demonstration datasets
collected on a UR5e arm.
---
## Datasets
| Name | Path | Episodes |
|------|------|----------|
| `pick_place_bottle_groot` | `real-robot_demo/pick_place_bottle_groot/` | 37 |
| `gr00t_bread` | `real-robot_demo/gr00t_bread/` | 25 |
Both datasets are in the LeRobot format (`data/`, `videos/`, `meta/`).
---
## Repository layout (under `$WORKSPACE/yu/`)
```
yu/
β”œβ”€β”€ finetune_real_robot.sh # Slurm job β€” pick_place_bottle_groot
β”œβ”€β”€ finetune_gr00t_bread.sh # Slurm job β€” gr00t_bread
β”œβ”€β”€ upload_hf_gr00t_real.sh # Slurm job β€” upload datasets to HF
β”œβ”€β”€ launch_finetune_local.py # Training entry-point (copy of Isaac-GR00T/scripts/)
β”œβ”€β”€ real_robot_ur5_config.py # Modality config for UR5e (copy of Isaac-GR00T/scripts/)
β”œβ”€β”€ Isaac-GR00T/ # GR00T source repo
β”‚ └── scripts/
β”‚ β”œβ”€β”€ launch_finetune_local.py
β”‚ β”œβ”€β”€ real_robot_ur5_config.py
β”‚ └── finetune_jobs/
β”‚ β”œβ”€β”€ finetune_real_robot.sh
β”‚ └── finetune_gr00t_bread.sh
β”œβ”€β”€ real-robot_demo/
β”‚ β”œβ”€β”€ pick_place_bottle_groot/
β”‚ └── gr00t_bread/
└── groot17_checkpoints/
β”œβ”€β”€ pick_place_bottle_groot/checkpoint-10000/
└── gr00t_bread/checkpoint-10000/
```
---
## Training command
Both jobs run the same command with different `--dataset_path` / `--output_dir`.
```bash
torchrun --nproc_per_node=4 --master_port=29500 \
Isaac-GR00T/scripts/launch_finetune_local.py \
--base_model_path nvidia/GR00T-N1.7-3B \
--dataset_path <DATASET_PATH> \
--embodiment_tag NEW_EMBODIMENT \
--modality_config_path Isaac-GR00T/scripts/real_robot_ur5_config.py \
--num_gpus 4 \
--output_dir <OUTPUT_DIR> \
--save_steps 1000 \
--save_total_limit 1 \
--max_steps 10000 \
--warmup_ratio 0.05 \
--weight_decay 1e-5 \
--learning_rate 1e-4 \
--global_batch_size 32 \
--dataloader_num_workers 4 \
--shard_size 1024 \
--num_shards_per_epoch 100000 \
--episode_sampling_rate 0.1 \
--color_jitter_params brightness 0.3 contrast 0.4 saturation 0.5 hue 0.08 \
--save_only_model
```
### Per-job values
| Argument | `pick_place_bottle_groot` | `gr00t_bread` |
|---|---|---|
| `--dataset_path` | `real-robot_demo/pick_place_bottle_groot` | `real-robot_demo/gr00t_bread` |
| `--output_dir` | `groot17_checkpoints/pick_place_bottle_groot` | `groot17_checkpoints/gr00t_bread` |
---
## Training hyperparameters
| Parameter | Value | Notes |
|---|---|---|
| Base model | `nvidia/GR00T-N1.7-3B` | GR00T N1.7 3B |
| Max steps | 10 000 | |
| Learning rate | 1e-4 | AdamW |
| Weight decay | 1e-5 | |
| Warmup ratio | 0.05 | 500 steps |
| Global batch size | 32 | 4 GPUs, effective BS=32 |
| GPUs | 4 Γ— A100 (80 GB) | `batch_long` partition |
| Save every | 1 000 steps | keep last 1 only |
| Episode sampling rate | 0.1 | 10 % per shard pass |
| Shards per epoch | 100 000 | |
| Shard size | 1 024 | |
| Color jitter | brightness 0.3 / contrast 0.4 / saturation 0.5 / hue 0.08 | |
| Save mode | `--save_only_model` | no optimizer state saved |
---
## Modality config (`real_robot_ur5_config.py`)
UR5e with EEF absolute control + continuous gripper, two cameras.
```
State : eef (6-dim: xyz + axis-angle), gripper (1-dim)
Action : eef (ABSOLUTE, XYZ_ROTVEC), gripper (ABSOLUTE, DEFAULT)
horizon = 16 steps
Video : cam0, cam1 (delta_indices=[0])
Language: annotation.human.task_description
```
---
## Submitting jobs
```bash
cd $WORKSPACE/yu
# Train pick_place_bottle_groot
sbatch finetune_real_robot.sh
# Train gr00t_bread
sbatch finetune_gr00t_bread.sh
# Upload datasets to HuggingFace (yqi19/gr00t-real)
sbatch upload_hf_gr00t_real.sh
```
Check status:
```bash
squeue -u $USER -j <JOBID>
tail -f $WORKSPACE/yu/logs/groot17_real_robot_<JOBID>.out
tail -f $WORKSPACE/yu/logs/groot17_gr00t_bread_<JOBID>.out
```
---
## Checkpoints (job 895192 / 895193, May 5-6 2026)
| Dataset | Checkpoint path | Steps | Final loss |
|---|---|---|---|
| `pick_place_bottle_groot` | `groot17_checkpoints/pick_place_bottle_groot/checkpoint-10000/` | 10 000 | ~0.05 |
| `gr00t_bread` | `groot17_checkpoints/gr00t_bread/checkpoint-10000/` | 10 000 | ~0.05 |
Checkpoint contents:
```
checkpoint-10000/
β”œβ”€β”€ config.json
β”œβ”€β”€ embodiment_id.json
β”œβ”€β”€ experiment_cfg
β”œβ”€β”€ model-00001-of-00002.safetensors
β”œβ”€β”€ model-00002-of-00002.safetensors
β”œβ”€β”€ model.safetensors.index.json
β”œβ”€β”€ processor_config.json
β”œβ”€β”€ statistics.json
β”œβ”€β”€ trainer_state.json
β”œβ”€β”€ training_args.bin
└── wandb_config.json
```
---
## Environment
```
Conda env : $WORKSPACE/conda_envs/GR00T17
Python : 3.10
flash-attn: 2.7.4.post1 (cu12, torch2.7, cxx11abiFALSE)
WANDB : disabled
HF_HOME : $WORKSPACE/hugging_face
```