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

#ParameterDefaultDescription
1TASKrequiredTask folder name (e.g. 03_wine_glass_plate_balance)
2GPU_ID0CUDA device ID
3SEED0Random seed
4DATASET_DIR../../outputs/ur5_rh56dfx/scenes/{TASK}/replayHDF5 replay directory
5CKPT_DIR../../outputs/logs/act/{TASK}/exp_{datetime}Checkpoint output directory

Key Defaults

ParameterValue
ArchitectureResNet18 backbone, 4-layer encoder, 7-layer decoder
hidden_dim512
chunk_size30
kl_weight10
batch_size32
num_epochs6000
lr1e-5
Cameras4 (right_wrist, left_wrist, stereo_left, stereo_right)
Monitoring: View training curves with 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

FlagDefaultDescription
--generalization-profilenoneGeneralization channel: none, cov_only, inv_only, inv_cov
--anchor-dirautoAnchor HDF5 directory for generalization
--episode-steps NbudgetPolicy-step budget override
--max-steps NbudgetPhysics-step budget override
--headlessfalseRun without GUI
--use-active-doftrueEnable 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
The 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

FlagDefaultDescription
--gpu IDS0,1,2,3,4,5,6,7CUDA_VISIBLE_DEVICES
--lr LR1e-4Peak learning rate
--epochs N300Number of training epochs
--batch N512Global batch size (must be divisible by GPU count)
--warmup N500LR warmup steps
--workers N32DataLoader workers per GPU
--seed N42Random seed
--tag SUFFIXhomeAppend suffix to output directory
--no-tmuxtmux enabledRun in foreground
--config NAMErobot_dp_36_dex2scene_real.yamlHydra config name
--dataset PATHauto-searchExact HDF5 episodes directory
--resumeonResume from latest checkpoint

Key Architecture Defaults

ParameterValue
PolicyDiffusionUnetImagePolicy (DDPM, 100 denoising steps)
BackboneResNet18 (ImageNet-pretrained for _pretrained config)
Noise ScheduleSquaredcos_cap_v2 (cosine)
Horizon / n_obs / n_action8 / 3 / 6
U-Net down dims[256, 512, 1024]
OptimizerAdamW (lr=1e-4, betas=[0.95, 0.999])
CheckpointEvery 5 epochs, keep top-5 by test_mean_score
Data formatZarr (converted from HDF5, truncated at homing)
Checkpoints are saved every 5 epochs under ../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

FlagDefaultDescription
--channel CHnoneGeneralization channel
--num-episodes N50Number of episodes
--episodes-per-process N25Isaac restart interval (GPU memory release)
--cuda N0GPU device
--model-path PATHautoCheckpoint path override
--anchor-dir DIRautoAnchor HDF5 directory
--robot-key KEYautoRobot key override
--resumeoffResume previous evaluation
--siioffUse 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 ../..
Note: JAX models require GPU memory management. The environment sets 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

FlagDefaultDescription
--task NAMErequiredDex2Bench task name (full scene name)
--gpu-use IDS0CUDA_VISIBLE_DEVICES value
--exp-name NAMEexp_{timestamp}Experiment / checkpoint directory name
--dataset-dir PATH../../outputs/ur5_rh56dfx/scenes/{TASK}/replayHDF5 replay directory
--output-dir PATH../../outputs/logs/pi05Checkpoint base directory
--assets-base-dir PATH{output-dir}/_assetsNorm-stats / assets directory
--prompt TEXTfrom scenes/{TASK}.yamlLanguage prompt for the policy
--train-config NAMEpi05_base_dex2bench_fullTraining configuration name
--batch-size Nfrom configBatch size (forwarded to train.py)
--num-workers Nfrom configDataLoader workers
--robot-key KEYauto-detected from HDF5Robot registry key (overrides auto-detection)
--siioffUse conda environment instead of uv
--recompute-norm-statsoffForce recompute normalization statistics
-- ARGS...Pass through to scripts/train.py

Key Training Defaults (from deploy_policy.yml)

ParameterValue
Train configpi05_base_dex2bench_full (full fine-tune)
Action horizon20
Batch size256
Training steps2000
Save interval1000 steps
Peak LR1e-4 → decay to 1e-6
Warmup steps100
FSDP devices1
Workers32
Robot keyauto-detected from HDF5
Checkpoint output structure: 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

FlagDefaultDescription
--anchor-dir PATHpositionalReplay HDF5 directory for anchor channels
--generalization-split SPLITunseenScene split: seen, unseen, all
--episodes-per-process N0Restart Isaac every N episodes (memory release)
--channels LISTnone,cov,inv,inv_covComma-separated channels to run
--keep-goingoffContinue if one channel fails
--record-successoffSave successful-episode HDF5 + MP4
--record-alloffSave all episodes (success + failure)
--siioffUse conda environments
--robot-key KEYpositional / autoRobot 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

FlagDefaultDescription
--env-name NAMEGR00T_n15Conda environment name
--python VERSION3.10Python version
--model-id IDnv-community/GR00T-N1.5-3B-WaveHandModelScope model ID
--skip-model-downloadSkip weight download
--skip-installSkip pip install
The script writes cache environment variables (HF_HOME, TORCH_HOME, etc.) to project-local .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

FlagDefaultDescription
--gpu IDS0CUDA_VISIBLE_DEVICES
--lr LR1e-4Peak learning rate
--steps N20000Max training steps
--batch N64Global batch size
--save-steps N1000Checkpoint save interval (steps)
--workers N12DataLoader workers
--seed N42Random seed
--tag SUFFIXbs64_step20000_gpu1_lr1Output dir suffix
--resumeoffResume from latest checkpoint
--no-tmuxtmux enabledRun in foreground
--dataset PATHauto-searchExact HDF5 episodes directory

Key Architecture Defaults

ParameterValue
BackboneEagle 2.5 (frozen VLM)
Action headFlow-matching diffusion transformer (4 denoising steps)
Action horizon16
Camera mode4 cameras (stereo_left, stereo_right, right_wrist, left_wrist)
Embodiment tagnew_embodiment
Data formatHDF5-native (no LeRobot conversion needed)
Training typeLoRA fine-tuning
Checkpoints are saved every 1000 steps under ../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

FlagDefaultDescription
--channel CHnoneGeneralization channel
--num-episodes N50Number of episodes
--episodes-per-process N25Isaac restart interval
--cuda N0GPU device
--model-path PATHautoCheckpoint path override
--robot-key KEYautoRobot key override
--resumeoffResume previous evaluation
--siioffUse Isaac Sim environment activation
Note: The 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/.

#TaskEmbodimentDescription
26Canned Food Tray ArrangementIIWA7+SharpaPlace master chef can, MSG, milk box, and potted meat can onto the tray.
32Baking Tray PrepPlace brush, spatula, pudding box, and gelatin box onto the tray.
73Jigsaw Puzzle AssemblyAssemble green, red, blue, yellow puzzle pieces onto the fixed white piece.
80Gaming Desk SetupJAKA ZU7+DexHand021Straighten monitor, press ESC key, move mouse, click left button.
22Tool Box LoadingPanda+OrcaPlace drill, flat screwdriver, wrench, and Phillips screwdriver into the box.
61Medicine Shoebox PackPlace pill bottle, toothpaste, and hydrating oil into the shoe box.
64Sports Ball Cup SortPanda+AllegroSort tennis ball, baseball, racquetball, and golf ball into large/small cups.
24Stationery Category SortingRM65+Revo2Sort marker, battery, pen, and glue into pen cup and plastic box.
67Faucet Cup Water FillPlace spoon into mug, fill mug under faucet, place mug onto tray.
03Wine Glass Plate BalancexArm7+AbilityCarry three filled wine glasses to plates without spilling.
79Bimanual Piano MelodyBoth hands play piano key sequence C-C-G-G-A-A-G.
09Cleaner Box LoadingxArm7+LEAPLift cleaner and soap, place upright into wooden box.
51Toilet Lid Cleaner PourOpen lid, pour cleaner into toilet, close lid.
62Shoebox Accessory PackPlace seal, shoe, and pet collar into the shoe box.
07Citrus Plate LoadingUR5+RH5DG2Place lemon and orange pairs onto plates.
34Fridge Wine Interhand PourTake bottle from fridge, pour wine, return and close door.
60Breadbasket Fast-Food LoadingPlace baguette, bread, and fries into the bread basket.
06Fruit Bowl LoadingUR5+RH56DFXMove bowl to center, place apples and banana into it.
12Screwdriver Box & HammerPlace screwdrivers into box, strike with hammer, return it.
42Height-Sorted Trash DisposalOpen lid, throw paper, bottle, banana peel, close lid.
43Fridge Fruit Shelf SortingUR5+Shadow HandOpen fridge, place apple on upper shelf, banana on lower shelf.
76Soup ServingLadle soup from pot into bowl, serve, return ladle.
08Frypan Stand & PourUR5+Schunk HandPlace frypan on stand, pour soy sauce and olive oil.
44Microwave Bowl LoadingOpen door, place bowl with baguette, close door.
21Condiment Box LoadingUR5+WujiPlace MSG, soy sauce, and vinegar into the box.
27Ball Box LoadingPlace mini soccer, tennis, golf, and ping-pong balls into the box.

Bench2Dex Documentation. For the latest updates, see the Bench2Dex GitHub repository.