Bench2Dex Documentation
Tasks, Training & Evaluation Guide
Bench2Dex supports four policy families for imitation learning on dexterous manipulation tasks.
Each policy has its own environment setup, training procedure, and evaluation commands.
Below we document each policy in detail, using task 03_wine_glass_plate_balance as a running example.
Policy
Bench2Dex supports four imitation learning policy families. Each has its own framework, environment setup, training procedure, and evaluation commands.
1. ACT (Action Chunking with Transformers)
ACT is a behavior-cloning policy that uses a CVAE (Conditional Variational Autoencoder) transformer architecture to predict action chunks. It is built on a ResNet18 backbone with a DETR-style transformer encoder–decoder. The implementation is adapted from the original ACT repository.
Environment Setup
Create a uv-managed Python 3.9 virtual environment with PyTorch and all dependencies:
cd policy/ACT
bash env.sh # Build uv virtual environment
cd ../..
The script automatically installs uv if missing, creates .venv/, installs PyTorch 2.0.0 (CUDA 11.8), and all required packages (numpy, opencv-python, mujoco, h5py, etc.).
A conda alternative is also provided via conda_env.yaml:
conda env create -f policy/ACT/conda_env.yaml
conda activate act
Training
The training script supports positional arguments and automatic path resolution.
Basic Usage
# Default: uses outputs/ur5_rh56dfx/scenes/<TASK>/replay/
bash policy/ACT/train.sh 03_wine_glass_plate_balance
# Specify GPU and seed
bash policy/ACT/train.sh 03_wine_glass_plate_balance 0 1
# With custom dataset and output paths
bash policy/ACT/train.sh 03_wine_glass_plate_balance 0 1 /path/to/replay /path/to/output
# Train on generalized data (covariate / inv-covariate)
bash policy/ACT/train.sh 03_wine_glass_plate_balance 0 1 cov_only
bash policy/ACT/train.sh 03_wine_glass_plate_balance 0 1 inv_cov
Positional Arguments
| # | Parameter | Default | Description |
|---|---|---|---|
| 1 | TASK | required | Task folder name (e.g. 03_wine_glass_plate_balance) |
| 2 | GPU_ID | 0 | CUDA device ID |
| 3 | SEED | 0 | Random seed |
| 4 | DATASET_DIR | ../../outputs/ur5_rh56dfx/scenes/{TASK}/replay | HDF5 replay directory |
| 5 | CKPT_DIR | ../../outputs/logs/act/{TASK}/exp_{datetime} | Checkpoint output directory |
Key Defaults
| Parameter | Value |
|---|---|
| Architecture | ResNet18 backbone, 4-layer encoder, 7-layer decoder |
hidden_dim | 512 |
chunk_size | 30 |
kl_weight | 10 |
batch_size | 32 |
num_epochs | 6000 |
lr | 1e-5 |
| Cameras | 4 (right_wrist, left_wrist, stereo_left, stereo_right) |
tensorboard --logdir ../../outputs/logs/act/{TASK}/exp_.../tb_logs
Evaluation & Inference
ACT provides three evaluation modes, each suited for different use cases.
Direct Evaluation (Recommended for Quick Validation)
Runs inference directly without a server/client — ideal for rapid testing:
bash policy/ACT/eval_direct.sh 03_wine_glass_plate_balance \
./outputs/logs/act/03_wine_glass_plate_balance/exp_20250101_120000/ \
policy_last.ckpt 0 50 100000000 --max-steps 2400
Server/Client Evaluation
Connects to an existing model server (or starts one):
bash policy/ACT/eval.sh 03_wine_glass_plate_balance \
./outputs/logs/act/03_wine_glass_plate_balance/exp_20250101_120000/ \
policy_last.ckpt 0 50 100000000
Double-Environment Evaluation (Full Channel Support)
Starts both a model server and an Isaac Sim client, supporting generalization profiles and Isaac restarts:
bash policy/ACT/eval_double_env.sh 03_wine_glass_plate_balance \
./outputs/logs/act/03_wine_glass_plate_balance/exp_20250101_120000/ \
policy_best.ckpt 0 50 100000000 --headless \
--generalization-profile none
Available Evaluation Flags
| Flag | Default | Description |
|---|---|---|
--generalization-profile | none | Generalization channel: none, cov_only, inv_only, inv_cov |
--anchor-dir | auto | Anchor HDF5 directory for generalization |
--episode-steps N | budget | Policy-step budget override |
--max-steps N | budget | Physics-step budget override |
--headless | false | Run without GUI |
--use-active-dof | true | Enable active DOF mode |
2. DP (Diffusion Policy)
Diffusion Policy uses a diffusion model (DDPM) over a U-Net architecture to generate action sequences conditioned on visual observations. It employs a ResNet18 multi-image encoder with 4 RGB cameras and a cosine-scheduled noise scheduler. The implementation is adapted from the Diffusion Policy and RoboTwin projects.
Environment Setup
Two environment options are available:
Option A: uv Virtual Environment
cd policy/DP
bash env.sh # Build uv virtual environment
cd ../..
Option B: Conda Environment
conda env create -f policy/DP/dp_env.yml
conda activate dp
dp_env.yml provides a frozen environment with PyTorch 2.8.0 + CUDA 12.8.
The env.sh script uses PyTorch 2.0.0 + CUDA 11.8. Choose based on your system compatibility.
Training
Training takes a task number and auto-discovers dataset paths. It uses Hydra for configuration management.
Basic Usage
# Single GPU (defaults to all 8 GPUs, use --gpu to restrict)
bash policy/DP/train.sh 03
# 4-GPU DDP training with custom learning rate
bash policy/DP/train.sh 03 --gpu 0,1,2,3 --lr 1e-4
# Foreground training (no tmux)
bash policy/DP/train.sh 03 --no-tmux --epochs 300
# Custom dataset directory
bash policy/DP/train.sh 03 --dataset /path/to/episodes
# Dry-run to inspect the command
bash policy/DP/train.sh 03 --dry-run
Training Flags
| Flag | Default | Description |
|---|---|---|
--gpu IDS | 0,1,2,3,4,5,6,7 | CUDA_VISIBLE_DEVICES |
--lr LR | 1e-4 | Peak learning rate |
--epochs N | 300 | Number of training epochs |
--batch N | 512 | Global batch size (must be divisible by GPU count) |
--warmup N | 500 | LR warmup steps |
--workers N | 32 | DataLoader workers per GPU |
--seed N | 42 | Random seed |
--tag SUFFIX | home | Append suffix to output directory |
--no-tmux | tmux enabled | Run in foreground |
--config NAME | robot_dp_36_dex2scene_real.yaml | Hydra config name |
--dataset PATH | auto-search | Exact HDF5 episodes directory |
--resume | on | Resume from latest checkpoint |
Key Architecture Defaults
| Parameter | Value |
|---|---|
| Policy | DiffusionUnetImagePolicy (DDPM, 100 denoising steps) |
| Backbone | ResNet18 (ImageNet-pretrained for _pretrained config) |
| Noise Schedule | Squaredcos_cap_v2 (cosine) |
| Horizon / n_obs / n_action | 8 / 3 / 6 |
| U-Net down dims | [256, 512, 1024] |
| Optimizer | AdamW (lr=1e-4, betas=[0.95, 0.999]) |
| Checkpoint | Every 5 epochs, keep top-5 by test_mean_score |
| Data format | Zarr (converted from HDF5, truncated at homing) |
../policy_ckpt/03/.
The script automatically converts HDF5 → Zarr on the first run (truncated at the homing-start frame).
Evaluation & Inference
Server/Client Evaluation
bash policy/DP/eval.sh 03_wine_glass_plate_balance \
../policy_ckpt/03/multi_ur5_rh56dfx_with_flange/dp_home/checkpoints/ \
bs512_ep300.ckpt 0 50 100000000
Double-Environment Evaluation (Channel Support)
# Single channel (no generalization)
bash policy/DP/eval_double_env.sh 03
# Covariate generalization
bash policy/DP/eval_double_env.sh 03 cov
# Full generalization (invariant + covariate)
bash policy/DP/eval_double_env.sh 03 inv_cov
# All 4 channels sequentially
bash policy/DP/eval_double_env.sh 03 all
Available Flags for eval_double_env.sh
| Flag | Default | Description |
|---|---|---|
--channel CH | none | Generalization channel |
--num-episodes N | 50 | Number of episodes |
--episodes-per-process N | 25 | Isaac restart interval (GPU memory release) |
--cuda N | 0 | GPU device |
--model-path PATH | auto | Checkpoint path override |
--anchor-dir DIR | auto | Anchor HDF5 directory |
--robot-key KEY | auto | Robot key override |
--resume | off | Resume previous evaluation |
--sii | off | Use Isaac Sim environment |
3. Pi0.5
Pi0.5 is a JAX-based vision-language-action (VLA) model from
Physical Intelligence.
Bench2Dex integrates Pi0.5 via the openpi library with full fine-tuning and WebSocket-based
model serving. It uses the pi0_fast architecture with a Gemma + SigLIP backbone.
Environment Setup
Pi0.5 uses a uv-managed virtual environment (JAX-based, not PyTorch):
cd policy/pi05
GIT_LFS_SKIP_SMUDGE=1 uv sync # Build uv virtual environment (JAX)
cd ../..
XLA_PYTHON_CLIENT_MEM_FRACTION=0.95 for training and 0.5 for serving.
Use the --sii flag to switch to a conda-based environment if uv is unavailable.
Training (Full Fine-Tuning)
Pi0.5 fine-tunes a pretrained base model with full-parameter training, loading the base weights from ModelScope/S3.
Basic Usage
# 8-GPU training with all defaults
bash policy/pi05/finetune.sh --task 03_wine_glass_plate_balance \
--gpu-use 0,1,2,3,4,5,6,7 --exp-name my_exp \
--dataset-dir /path/to/replay --output-dir /path/to/logs/pi05
# Specify robot key explicitly (overrides auto-detection)
bash policy/pi05/finetune.sh --task 03_wine_glass_plate_balance \
--gpu-use 0,1,2,3,4,5,6,7 --exp-name my_exp \
--dataset-dir /path/to/replay --output-dir /path/to/logs/pi05 \
--robot-key multi_ur5_rh56dfx_with_flange
Training Flags
| Flag | Default | Description |
|---|---|---|
--task NAME | required | Dex2Bench task name (full scene name) |
--gpu-use IDS | 0 | CUDA_VISIBLE_DEVICES value |
--exp-name NAME | exp_{timestamp} | Experiment / checkpoint directory name |
--dataset-dir PATH | ../../outputs/ur5_rh56dfx/scenes/{TASK}/replay | HDF5 replay directory |
--output-dir PATH | ../../outputs/logs/pi05 | Checkpoint base directory |
--assets-base-dir PATH | {output-dir}/_assets | Norm-stats / assets directory |
--prompt TEXT | from scenes/{TASK}.yaml | Language prompt for the policy |
--train-config NAME | pi05_base_dex2bench_full | Training configuration name |
--batch-size N | from config | Batch size (forwarded to train.py) |
--num-workers N | from config | DataLoader workers |
--robot-key KEY | auto-detected from HDF5 | Robot registry key (overrides auto-detection) |
--sii | off | Use conda environment instead of uv |
--recompute-norm-stats | off | Force recompute normalization statistics |
-- ARGS... | — | Pass through to scripts/train.py |
Key Training Defaults (from deploy_policy.yml)
| Parameter | Value |
|---|---|
| Train config | pi05_base_dex2bench_full (full fine-tune) |
| Action horizon | 20 |
| Batch size | 256 |
| Training steps | 2000 |
| Save interval | 1000 steps |
| Peak LR | 1e-4 → decay to 1e-6 |
| Warmup steps | 100 |
| FSDP devices | 1 |
| Workers | 32 |
| Robot key | auto-detected from HDF5 |
outputs/logs/pi05/pi05_base_dex2bench_lora/<exp>/<step>/
Evaluation & Inference
Pi0.5 uses a split server/client architecture: a JAX model server runs in the openpi environment,
while the Isaac Sim client runs in the dex2bench environment.
Single-Channel Evaluation
# All optional positionals (train_config, gpu_id, num_episodes, seed) use script defaults
bash policy/pi05/eval_double_env.sh 03_wine_glass_plate_balance \
multi_ur5_rh56dfx_with_flange \ # ← positional robot key
./outputs/logs/pi05/pi05_base_dex2bench_full/my_exp/2000/ \
--channel none \
--anchor-dir /path/to/replay-generalization
All-Channel Evaluation (Recommended)
# robot key is the 2nd positional argument (multi_ur5_rh56dfx_with_flange)
# All optional positionals (train_config, gpu_id, num_episodes, seed) use script defaults
bash policy/pi05/eval_all_channels.sh 03_wine_glass_plate_balance \
multi_ur5_rh56dfx_with_flange \ # ← positional robot key
./outputs/logs/pi05/pi05_base_dex2bench_full/my_exp/2000/ \
/path/to/replay-generalization
The eval_all_channels.sh script runs all four generalization channels (none, cov, inv, inv_cov) sequentially and produces a single success_rates.tsv summary.
Key Evaluation Flags
| Flag | Default | Description |
|---|---|---|
--anchor-dir PATH | positional | Replay HDF5 directory for anchor channels |
--generalization-split SPLIT | unseen | Scene split: seen, unseen, all |
--episodes-per-process N | 0 | Restart Isaac every N episodes (memory release) |
--channels LIST | none,cov,inv,inv_cov | Comma-separated channels to run |
--keep-going | off | Continue if one channel fails |
--record-success | off | Save successful-episode HDF5 + MP4 |
--record-all | off | Save all episodes (success + failure) |
--sii | off | Use conda environments |
--robot-key KEY | positional / auto | Robot registry key (2nd positional arg in both scripts; --robot-key flag overrides) |
4. GR00T N1.5
GR00T N1.5 is NVIDIA's open foundation model for generalist robot manipulation. It uses a vision-language backbone (Eagle 2.5) with a diffusion-transformer action head. Bench2Dex integrates a vendored copy of Isaac-GR00T with HDF5-native data loading and LoRA fine-tuning support. The default base model is the N1.5-derived WaveHand checkpoint from ModelScope.
Environment Setup
The setup script creates a conda environment, installs dependencies, and downloads the base model:
# Full setup (conda env + dependencies + model download)
bash policy/GR00T_n15/setup_env.sh
# Skip model download (environment only)
bash policy/GR00T_n15/setup_env.sh --skip-model-download
# Use a different model
bash policy/GR00T_n15/setup_env.sh \
--model-id nv-community/GR00T-N1.5-3B-WaveHand
Setup Options
| Flag | Default | Description |
|---|---|---|
--env-name NAME | GR00T_n15 | Conda environment name |
--python VERSION | 3.10 | Python version |
--model-id ID | nv-community/GR00T-N1.5-3B-WaveHand | ModelScope model ID |
--skip-model-download | — | Skip weight download |
--skip-install | — | Skip pip install |
.cache/ directories and creates conda activate/deactivate hooks for automatic
environment variable management. A .env file is also generated for reference.
Training
GR00T N1.5 fine-tunes using HDF5-native mode — reading .hdf5 files directly without
converting to LeRobot format. Training scripts support LoRA-based fine-tuning.
Basic Usage
# Single GPU (default)
bash policy/GR00T_n15/train.sh 03
# Multi-GPU with custom batch size
bash policy/GR00T_n15/train.sh 03 --gpu 0,1,2,3 --batch 64
# Custom hyperparameters with tag
bash policy/GR00T_n15/train.sh 03 --lr 2e-4 --steps 10000 --tag v1
# Foreground training (no tmux)
bash policy/GR00T_n15/train.sh 03 --no-tmux
Training Flags
| Flag | Default | Description |
|---|---|---|
--gpu IDS | 0 | CUDA_VISIBLE_DEVICES |
--lr LR | 1e-4 | Peak learning rate |
--steps N | 20000 | Max training steps |
--batch N | 64 | Global batch size |
--save-steps N | 1000 | Checkpoint save interval (steps) |
--workers N | 12 | DataLoader workers |
--seed N | 42 | Random seed |
--tag SUFFIX | bs64_step20000_gpu1_lr1 | Output dir suffix |
--resume | off | Resume from latest checkpoint |
--no-tmux | tmux enabled | Run in foreground |
--dataset PATH | auto-search | Exact HDF5 episodes directory |
Key Architecture Defaults
| Parameter | Value |
|---|---|
| Backbone | Eagle 2.5 (frozen VLM) |
| Action head | Flow-matching diffusion transformer (4 denoising steps) |
| Action horizon | 16 |
| Camera mode | 4 cameras (stereo_left, stereo_right, right_wrist, left_wrist) |
| Embodiment tag | new_embodiment |
| Data format | HDF5-native (no LeRobot conversion needed) |
| Training type | LoRA fine-tuning |
../policy_ckpt/03/<robot_key>/gr00t_n15_trunc_<tag>/.
Default tag auto-encodes batch size, steps, GPU count, and learning rate.
Evaluation & Inference
Server/Client Evaluation
bash policy/GR00T_n15/eval.sh 03_wine_glass_plate_balance \
../policy_ckpt/03/multi_ur5_rh56dfx_with_flange/gr00t_n15_tr00tbs64_step20000_gpu1_lr1/ \
0 50 100000000
Double-Environment Evaluation (Channel Support)
# Single channel (no generalization)
bash policy/GR00T_n15/eval_double_env.sh 03
# Covariate generalization
bash policy/GR00T_n15/eval_double_env.sh 03 cov
# Full generalization
bash policy/GR00T_n15/eval_double_env.sh 03 inv_cov
# All 4 channels sequentially
bash policy/GR00T_n15/eval_double_env.sh 03 all
Available Flags for eval_double_env.sh
| Flag | Default | Description |
|---|---|---|
--channel CH | none | Generalization channel |
--num-episodes N | 50 | Number of episodes |
--episodes-per-process N | 25 | Isaac restart interval |
--cuda N | 0 | GPU device |
--model-path PATH | auto | Checkpoint path override |
--robot-key KEY | auto | Robot key override |
--resume | off | Resume previous evaluation |
--sii | off | Use Isaac Sim environment activation |
eval_double_env.sh scripts for DP and GR00T N1.5 share a common
interface (task ID + channel). When using all, they automatically compute
cross-channel robustness metrics and produce a metrics_comparison.csv summary.
5. Tasks
Bench2Dex provides 26 long-horizon bimanual dexterous manipulation tasks
spanning 12 robot embodiments. Each task involves coordinated
two-hand operations such as precision grasping, tool use, articulated-object
interaction, pouring, and multi-stage assembly. The table below lists all
available scenes grouped by embodiment, with descriptions extracted from
the scene configuration files in scenes/.
| # | Task | Embodiment | Description |
|---|---|---|---|
| 26 | Canned Food Tray Arrangement | IIWA7+Sharpa | Place master chef can, MSG, milk box, and potted meat can onto the tray. |
| 32 | Baking Tray Prep | Place brush, spatula, pudding box, and gelatin box onto the tray. | |
| 73 | Jigsaw Puzzle Assembly | Assemble green, red, blue, yellow puzzle pieces onto the fixed white piece. | |
| 80 | Gaming Desk Setup | JAKA ZU7+DexHand021 | Straighten monitor, press ESC key, move mouse, click left button. |
| 22 | Tool Box Loading | Panda+Orca | Place drill, flat screwdriver, wrench, and Phillips screwdriver into the box. |
| 61 | Medicine Shoebox Pack | Place pill bottle, toothpaste, and hydrating oil into the shoe box. | |
| 64 | Sports Ball Cup Sort | Panda+Allegro | Sort tennis ball, baseball, racquetball, and golf ball into large/small cups. |
| 24 | Stationery Category Sorting | RM65+Revo2 | Sort marker, battery, pen, and glue into pen cup and plastic box. |
| 67 | Faucet Cup Water Fill | Place spoon into mug, fill mug under faucet, place mug onto tray. | |
| 03 | Wine Glass Plate Balance | xArm7+Ability | Carry three filled wine glasses to plates without spilling. |
| 79 | Bimanual Piano Melody | Both hands play piano key sequence C-C-G-G-A-A-G. | |
| 09 | Cleaner Box Loading | xArm7+LEAP | Lift cleaner and soap, place upright into wooden box. |
| 51 | Toilet Lid Cleaner Pour | Open lid, pour cleaner into toilet, close lid. | |
| 62 | Shoebox Accessory Pack | Place seal, shoe, and pet collar into the shoe box. | |
| 07 | Citrus Plate Loading | UR5+RH5DG2 | Place lemon and orange pairs onto plates. |
| 34 | Fridge Wine Interhand Pour | Take bottle from fridge, pour wine, return and close door. | |
| 60 | Breadbasket Fast-Food Loading | Place baguette, bread, and fries into the bread basket. | |
| 06 | Fruit Bowl Loading | UR5+RH56DFX | Move bowl to center, place apples and banana into it. |
| 12 | Screwdriver Box & Hammer | Place screwdrivers into box, strike with hammer, return it. | |
| 42 | Height-Sorted Trash Disposal | Open lid, throw paper, bottle, banana peel, close lid. | |
| 43 | Fridge Fruit Shelf Sorting | UR5+Shadow Hand | Open fridge, place apple on upper shelf, banana on lower shelf. |
| 76 | Soup Serving | Ladle soup from pot into bowl, serve, return ladle. | |
| 08 | Frypan Stand & Pour | UR5+Schunk Hand | Place frypan on stand, pour soy sauce and olive oil. |
| 44 | Microwave Bowl Loading | Open door, place bowl with baguette, close door. | |
| 21 | Condiment Box Loading | UR5+Wuji | Place MSG, soy sauce, and vinegar into the box. |
| 27 | Ball Box Loading | Place mini soccer, tennis, golf, and ping-pong balls into the box. |
Bench2Dex Documentation. For the latest updates, see the Bench2Dex GitHub repository.