Rlds export

From VectorSpaceLab/AREX-Skill · View interactive version

Rlds export is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. This skill exports LeRobot datasets to RLDS/TFDS with feature mapping, image and depth normalization, episode boundaries, metadata, and optional Apache Beam controls.

How to use this skill

Skill file

LeRobot → RLDS/TFDS export

Use this route when a user needs a local LeRobot dataset represented as an

RLDS/TFDS dataset for an RLDS consumer such as an offline-RL, imitation-learning,

or VLA pipeline. It covers the exporter contract and safe planning; it does not

ship or execute a full data-conversion wrapper.

Boundary and routing

the feature columns required by the requested RLDS schema.

TFRecord storage, plus the requested dataset metadata.

For that reverse direction, route to openx-conversion.

text. Stop for a schema decision when a required field is absent or ambiguous.

separately approved for replacement. Never push to a Hub from this route.

Read the linked references before choosing flags:

Required preflight

  1. Confirm the source and destination are different, writable local paths. Keep

the source unchanged and make a backup or new destination for retries.

  1. Inspect LeRobot metadata without iterating frames: feature keys, shapes,

dtypes, image/depth layouts, action cardinality, episode keys and lengths,

and whether every frame has a task string.

  1. Confirm the exporter-compatible LeRobot API. The evidence implementation

imports LeRobotDataset and LeRobotDatasetMetadata from

lerobot.datasets.lerobot_dataset; other LeRobot versions may expose these

symbols elsewhere. Resolve this import before any conversion attempt.

  1. Install TensorFlow and TensorFlow Datasets for TFRecord/RLDS generation. Keep

Apache Beam optional unless the user explicitly accepts its trade-offs.

  1. Decide direct versus Beam before writing. Direct mode is the default and the

required choice for small datasets or lossless episode preservation.

  1. Choose a valid TFDS builder name (--task-name) and semantic version

(--version, x.y.z). Record the encoding and all descriptive metadata.

If any preflight item is unknown, produce a validation plan rather than starting

an export. Do not use a successful import as evidence that a real dataset maps

correctly.

CLI contract

Use these arguments with the project’s equivalent exporter entry point; this

sub-skill intentionally does not provide a wrapper that performs large writes:

descriptions; keep the distinction if downstream catalog tooling uses both.

evidence default is multi_processing.

Validate paths, version syntax, encoding choice, and positive worker count before

invoking the exporter. --task-name is metadata, not a filter for source task

strings; use a distinct name when the output is a differently scoped dataset.

Conversion procedure

  1. Plan: freeze source metadata, output path, schema decisions, metadata

fields, and runner mode. Note whether a retry may reuse partial output.

  1. Build the schema: map supported LeRobot observation image, depth, state,

action, and task fields as described in data-formats.md. Reject unhandled

feature kinds instead of silently dropping them.

  1. Normalize each step: convert ordinary images to uint8 HWC from LeRobot

CHW values in [0, 1]; squeeze only a documented singleton depth channel;

preserve state/action numeric dtype and shape; map task text to

language_instruction.

  1. Group episodes: use source episode identity and metadata lengths. Emit

is_first on the first frame, and set both is_last and is_terminal on

the final frame only. is_terminal here means “episode ended at the last

available frame,” not a separately observed environment termination signal.

  1. Write: use TFDS/RLDS metadata and TFRecord output in a new destination.

Direct mode should be the first smoke path. Inspect counts and representative

shapes before considering a larger run.

  1. Review: verify the output split, episode count, step counts, metadata,

image encoding, depth rank, and boundary flags. Only then publish or hand the

directory to downstream tooling.

Runner choice and recovery

recommended path for small datasets. It is easier to diagnose because the

regular generator walks the LeRobot dataset once and closes each episode when

the episode index changes.

multi_processing or multi_threading and a bounded worker count. Use only

after a successful direct smoke test and when throughput justifies it.

saving. Treat any Beam run as potentially incomplete: compare episode ids and

counts, and rerun in direct mode if they differ. multi_threading has an

additional sharding/saving warning; prefer multi_processing when Beam is

approved.

after confirming it is the intended output, and rerun from a clean destination.

Do not “repair” missing episodes by editing boundary flags.

Safe verification

Before a real export, perform only safe checks:

flags and defaults without opening a dataset or creating output.

import Apache Beam only when Beam is selected. Do not download datasets or

instantiate a conversion builder during this check.

synthetic step records to a mapping implementation. Assert image CHW→HWC and

[0,1]→uint8, singleton depth behavior, state/action key mapping, task to

language_instruction, and exactly one first/last/terminal marker per episode.

Hub push, or large write as part of skill drafting or help verification.

Source basis: the Any4LeRobot LeRobot-to-RLDS README and its exporter module.

The source module is adapted into this contract and references only; no source

file, checkout path, or source script is a runtime dependency.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.