Skip to content

Mimic Isaaclab2lerobotdatasetV3 ValueError: The feature 'action' of shape '(8,)' does not have the expected shape '(6,)'. #142

@Axel-great

Description

@Axel-great

isaaclab2lerobot exports wrong action dimension for Mimic datasets

Bug description

When converting an IsaacLab HDF5 dataset to LeRobot format, the conversion path currently reads actions from episode_data._data["obs"]["actions"].

This is problematic for Mimic-generated / Mimic-postprocessed datasets.

In those datasets:

  • top-level actions may already be converted back to joint-space actions, for example shape (T, 6)
  • but obs/actions may still keep the intermediate Mimic action representation, for example shape (T, 8)

As a result, isaaclab2lerobot.py / isaaclab2lerobotv3.py can export the wrong action representation and produce 8D actions in the final LeRobot dataset, even though the final top-level actions are already 6D.

Affected code

Current logic in task templates:

obs_data = episode_data._data["obs"]
action = obs_data["actions"][-1]

This appears in:

  • source/leisaac/leisaac/tasks/template/single_arm_env_cfg.py
  • source/leisaac/leisaac/tasks/template/bi_arm_env_cfg.py
  • source/leisaac/leisaac/tasks/template/direct/single_arm_env.py
  • source/leisaac/leisaac/tasks/template/direct/bi_arm_env.py

Reproduction

Input dataset structure

For a final Mimic-processed dataset, I observed:

  • top-level actions: (263, 6)
  • obs/actions: (263, 8)

Example file:

  • final_generated_mimic-lift-cube-example.hdf5

Conversion

Run:

python scripts/convert/isaaclab2lerobotv3.py \
  --task_name <task_name> \
  --hdf5_root ./datasets \
  --hdf5_files final_generated_mimic-lift-cube-example.hdf5 \
  --repo_id <repo_id> \
  --fps 30

Expected behavior

The converter should prioritize the final top-level actions field when it exists:

episode_data._data["actions"]

and only fall back to:

episode_data._data["obs"]["actions"]

when top-level actions does not exist.

If both exist and have different shapes, it would be helpful to print a warning.

Actual behavior

The converter reads obs/actions, so the exported LeRobot dataset uses the 8D Mimic action representation instead of the final 6D joint action representation.

Why this matters

For Mimic workflows, the final dataset may intentionally contain:

  • top-level actions: final replay / joint-space actions
  • obs/actions: intermediate action representation used during generation

Using obs/actions silently changes the semantics of the exported action field.

Suggested fix

Use action resolution logic like:

if "actions" in episode_data._data:
    action = episode_data._data["actions"][-1]
elif "actions" in episode_data._data["obs"]:
    action = episode_data._data["obs"]["actions"][-1]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions