nvidia/i4h-workflow-finetune
Fine-tune a GR00T or openpi PI0 policy on a LeRobot dataset. Use when asked to finetune, train, or post-train a policy on demos; not for evaluating a checkpoint (use [[i4h-workflow-validate]]).
npx skills add https://github.com/NVIDIA/skills --skill i4h-workflow-finetune
Fine-tune a GR00T or openpi PI0 policy on an existing LeRobot dataset. Use when asked to finetune, train, or post-train a policy on recorded demos.
These steps drive the i4h-workflows base code (the workflows/agentic/ tree). To reuse an existing checkout, set I4H_WORKFLOWS to its path (no clone happens). Otherwise this resolves the current repo, or clones to ~/i4h-workflows — pick that default without prompting. Run every command below from the resolved root:
# Resolve the i4h-workflows base code (provides workflows/agentic/).
ROOT="${I4H_WORKFLOWS:-$(git rev-parse --show-toplevel 2>/dev/null)}"
if [ ! -d "$ROOT/workflows/agentic" ]; then
ROOT="${I4H_WORKFLOWS:-$HOME/i4h-workflows}"
[ -d "$ROOT/workflows/agentic" ] || git clone https://github.com/isaac-for-healthcare/i4h-workflows "$ROOT"
fi
export I4H_WORKFLOWS="$ROOT"; cd "$ROOT"
meta/info.json.policy.train_module in workflows/agentic/config/environments/<env>.yaml. A null value means inference-only.assemble_trocar is inference-only.| Env | Stack | CLI |
|---|---|---|
| scissor_pick_and_place | gr00t_n15 | i4h-agentic-gr00t-n15-train |
| locomanip_tray_pick_and_place | gr00t_n16 | i4h-agentic-gr00t-n16-train |
| locomanip_push_cart | gr00t_n16 | i4h-agentic-gr00t-n16-train |
| ultrasound_liver_scan | openpi_pi0 | i4h-agentic-openpi-pi0-train |
N1.6 locomanip envs share policy.locomanip.train.
test -f "${DATASET_PATH}/meta/info.json"
nvidia-smi --query-gpu=name --format=csv,noheader | wc -l
workflows/agentic/policy/<stack>/run.sh --list-envs
Run the steps below in order. Each step is a separate bash call; variables persist in the local agent's tmux session.
REPO_ROOT="${I4H_WORKFLOWS:-$(git rev-parse --show-toplevel 2>/dev/null)}"; [ -d "$REPO_ROOT/workflows/agentic" ] || REPO_ROOT="$HOME/i4h-workflows"
ENV_ID=scissor_pick_and_place
STACK_DIR=gr00t_n15
TRAIN_CLI=i4h-agentic-gr00t-n15-train
RUNS_ROOT="${REPO_ROOT}/workflows/agentic/runs"
# Point DATASET_PATH at a converted LeRobot dataset dir (absolute; must contain meta/info.json),
# produced by [[i4h-workflow-dataset-convert]]. List candidates:
# find "${RUNS_ROOT}" "${HF_LEROBOT_HOME:-$HOME/.cache/huggingface/lerobot}" -name info.json -path '*/meta/*' -printf '%h\n' | sed 's#/meta$##' | sort -u
DATASET_PATH="${DATASET_PATH:-}"
if [ ! -f "${DATASET_PATH%/}/meta/info.json" ]; then
echo "finetune: set DATASET_PATH to a LeRobot dataset dir with meta/info.json (got '${DATASET_PATH:-<unset>}'). Candidates:" >&2
find "${RUNS_ROOT}" "${HF_LEROBOT_HOME:-$HOME/.cache/huggingface/lerobot}" -name info.json -path '*/meta/*' -printf '%h\n' 2>/dev/null | sed 's#/meta$##' | sort -u | head
exit 1
fi
RUN_DIR="${RUNS_ROOT}/finetune_${ENV_ID}_$(date +%Y%m%d_%H%M%S)"
OUT="${RUN_DIR}/checkpoint"
export TMPDIR=/tmp # short path: torch DataLoader FD-sharing socket must fit AF_UNIX's 108-byte limit
mkdir -p "${OUT}" "${RUN_DIR}/logs"
ln -sfn "${RUN_DIR}" "${RUNS_ROOT}/.latest"
uv --directory "${REPO_ROOT}/workflows/agentic/policy/${STACK_DIR}" run "${TRAIN_CLI}" \
--env "${ENV_ID}" \
--dataset-path "${DATASET_PATH}" \
--output-dir "${OUT}" \
--max-steps 1000 \
--save-steps 1000 \
--num-gpus 1 \
2>&1 | tee "${RUN_DIR}/logs/finetune.log"
Tyro flags use kebab case (--max-steps, not --max_steps).
--dataset-path PATH (required)--output-dir PATH--base-model-path PATH_OR_REPO overrides YAML policy.model_repo--max-steps N, --save-steps N--batch-size N, --learning-rate FLOAT--no-tune-visual — freeze the vision backbone (trains the action head + projector only): ~2× faster, ~half the memory, less overfitting. Good default for small datasets; unfreeze only with lots of data + a real visual domain gap.--num-gpus N — must not exceed visible GPUs--report-to tensorboard|wandb${OUT}/checkpoint-<N> contains model-0000*-of-*.safetensors, experiment_cfg/, processor/.train_loss lines and a final 'train_runtime': ... summary..venv must exist).meta/info.json.policy.train_module non-null in workflows/agentic/config/environments/<env>.yaml (assemble_trocar is inference-only).--num-gpus must not exceed visible GPUs).policy.train_module, e.g. assemble_trocar) cannot be fine-tuned.--num-gpus must not exceed the count from nvidia-smi.policy.locomanip.train..venv missing. Fix: run [[i4h-workflow-setup]] first.meta/info.json - Cause: --dataset-path is not a valid LeRobot directory. Fix: point to a converted LeRobot dataset (see Preflight test -f).policy.train_module is null for that env. Fix: choose a train-capable env from the Stack Map.--max_steps - Cause: Tyro flags use kebab case. Fix: use --max-steps form.Report env, stack, dataset path, output checkpoint path, train_loss summary, and blockers.
Take nvidia/i4h-workflow-finetune from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.