VnRoboVnRobo
AboutPricingBlogContact
🇻🇳VISign InStart Free Trial
🇻🇳VI
VnRobo logoVnRobo logo

AI infrastructure for next-generation industrial robots.

Product

  • Features
  • Pricing
  • Knowledge Base
  • Services

Company

  • About Us
  • Blog
  • Contact

Legal

  • Privacy Policy
  • Terms of Service

© 2026 VnRobo. All rights reserved.

Made with♥in Vietnam
VnRoboVnRobo
AboutPricingBlogContact
🇻🇳VISign InStart Free Trial
🇻🇳VI
  1. Home
  2. Blog
  3. unifolm-vla + Unitree G1 (Post 3): data pipeline — JSON → LeRobot → HDF5 → RLDS
humanoidhumanoidvladata-pipelinelerobotrldsunitree-g1tutorial

unifolm-vla + Unitree G1 (Post 3): data pipeline — JSON → LeRobot → HDF5 → RLDS

3-step guide to converting teleoperation data: from JSON (xr_teleoperate) to LeRobot V2.1, to HDF5, to RLDS format ready for unifolm-vla training — with dataset verification at each step.

Nguyễn Anh TuấnJune 4, 20265 min readUpdated: Oct 9, 2026
unifolm-vla + Unitree G1 (Post 3): data pipeline — JSON → LeRobot → HDF5 → RLDS

unifolm-vla + Unitree G1 (Post 3): data pipeline — JSON → LeRobot → HDF5 → RLDS

This is post 3 of the unifolm-vla + Unitree G1 series. The previous post collected 50+ demos as JSON files. This post: converting data through 3 steps to make it ready for training.

It sounds like a lot of steps, but each step is just one command — this pipeline exists because it's designed to be reusable across different robots and training frameworks.

Pipeline overview

code
[xr_teleoperate output]        [unitree_IL_lerobot]
  JSON + video files    ──→    LeRobot V2.1 format
        ↓
[unifolm-vla prepare_data]
  LeRobot → HDF5               (more compact)
        ↓
[unifolm-vla prepare_data]
  HDF5 → RLDS                  (standard training format)
        ↓
[unifolm-vla training]
  RLDS → train_unifolm_vla.py

Why 3 steps?

  • LeRobot V2.1 is HuggingFace's standard format for robot datasets — easy to share, comes with verification tooling
  • HDF5 is a compact format with efficient I/O for training
  • RLDS (Reinforcement Learning Dataset Standard) is TensorFlow-based and used by many VLA training pipelines

Each format has separate verification tools — useful for debugging when something goes wrong.

Step 1: JSON → LeRobot V2.1

Using unitree_IL_lerobot:

bash
conda activate xr_teleop   # same env as xr_teleoperate
cd ~/unifolm_ws/unitree_IL_lerobot

# Basic command
python unitree_lerobot/utils/convert_unitree_json_to_lerobot.py \
    --raw-dir $HOME/unifolm_ws/xr_teleoperate/teleop/utils/data \
    --repo-id your_name/g1_pickplace_demo \
    --robot_type Unitree_G1_Dex3 \
    --push_to_hub

Flag breakdown:

Flag Example value Meaning
--raw-dir path to JSON data Output from xr_teleoperate
--repo-id your_name/g1_task HuggingFace repo ID (for push or local save)
--robot_type Unitree_G1_Dex3 G1 with Dex3 hands joint config
--push_to_hub (flag) Push to HuggingFace Hub (needs HF token)

To run offline (no HuggingFace push):

bash
python unitree_lerobot/utils/convert_unitree_json_to_lerobot.py \
    --raw-dir $HOME/unifolm_ws/xr_teleoperate/teleop/utils/data \
    --repo-id local/g1_pickplace_demo \
    --robot_type Unitree_G1_Dex3 \
    --local-dir $HOME/datasets/g1_pickplace_lerobot
    # drop --push_to_hub

Expected output:

code
Processing demo_0001... OK (87 frames)
Processing demo_0002... OK (92 frames)
...
Processing demo_0050... OK (81 frames)
Skipped: 2 demos (too short)
Converted: 48/50 demos
LeRobot dataset saved to: /home/user/datasets/g1_pickplace_lerobot/

Verify LeRobot dataset:

bash
pip install lerobot

python -c "
from lerobot.common.datasets.lerobot_dataset import LeRobotDataset

dataset = LeRobotDataset('local/g1_pickplace_demo',
                         local_files_only=True,
                         root='/home/user/datasets/g1_pickplace_lerobot')
print('Episodes:', dataset.num_episodes)
print('Frames:', len(dataset))
print('Features:', list(dataset.features.keys()))
"

# Expected output:
# Episodes: 48
# Frames: 4128
# Features: ['observation.images.left_wrist', 'observation.images.right_wrist',
#             'observation.state', 'action', 'timestamp', 'episode_index']

Step 2: LeRobot → HDF5

Using scripts in unifolm-vla:

bash
conda activate unifolm
cd ~/unifolm_ws/unifolm-vla

python prepare_data/convert_lerobot_to_hdf5.py \
    --lerobot_dir $HOME/datasets/g1_pickplace_lerobot \
    --output_dir $HOME/datasets/g1_pickplace_hdf5 \
    --robot_type g1_dex3

Expected output:

code
Converting episode 0/48...
Converting episode 1/48...
...
Conversion complete!
Output: /home/user/datasets/g1_pickplace_hdf5/
  ├── train/
  │   ├── episode_000.hdf5
  │   └── ... (43 files)
  └── val/
      └── ... (5 files)
Total: 43 train + 5 val episodes

Verify HDF5:

bash
python -c "
import h5py, glob

files = glob.glob('/home/user/datasets/g1_pickplace_hdf5/train/*.hdf5')
with h5py.File(files[0], 'r') as f:
    print('Keys:', list(f.keys()))
    print('Actions shape:', f['action'].shape)
    print('Frames:', f['action'].shape[0])
"

# Expected:
# Keys: ['action', 'obs', 'language_instruction']
# Actions shape: (87, 28)   ← 28 joints for G1 Dex3
# Frames: 87

Step 3: HDF5 → RLDS

Final conversion step to training format:

bash
cd ~/unifolm_ws/unifolm-vla/prepare_data/hdf5_to_rlds

# Install RLDS dependencies
pip install tensorflow tensorflow_datasets

# Run conversion
python hdf5_to_rlds.py \
    --hdf5_dir $HOME/datasets/g1_pickplace_hdf5 \
    --output_dir $HOME/datasets/g1_pickplace_rlds \
    --dataset_name g1_pickplace

Expected output:

code
Converting HDF5 → RLDS...
Writing train split: 43 episodes
Writing val split: 5 episodes
Shuffling train data...
Done! RLDS dataset at: /home/user/datasets/g1_pickplace_rlds/
  ├── g1_pickplace/
  │   └── 1.0.0/
  │       ├── g1_pickplace-train.tfrecord-00000-of-00001
  │       ├── g1_pickplace-val.tfrecord-00000-of-00001
  │       └── dataset_info.json

Verify RLDS:

bash
python -c "
import tensorflow_datasets as tfds

dataset = tfds.load(
    'g1_pickplace',
    data_dir='/home/user/datasets/g1_pickplace_rlds',
    split='train'
)

for batch in dataset.take(1):
    print('Steps per episode:', len(batch['steps']))
    step = batch['steps'][0]
    print('Action shape:', step['action'].shape)
    print('Language instruction:', step['language_instruction'].numpy().decode())
"

# Expected:
# Steps per episode: 87
# Action shape: (28,)
# Language instruction: pick up the red cup

Checklist before training

code
[ ] Step 1 (LeRobot):
    - Episodes = number of valid demos
    - Features include: images + state + action + timestamp
    
[ ] Step 2 (HDF5):
    - Action shape = (N_frames, 28) for G1 Dex3
    - Both train/ and val/ splits present
    - Train/val ratio ≈ 90/10
    
[ ] Step 3 (RLDS):
    - TFRecord files exist and are readable
    - Language instruction correct in each episode
    - No abruptly truncated episodes

Common errors

"Too few demos after filtering"

code
Cause: many demos filtered out (too short < 2 seconds)
Fix: collect more demos, or reduce min episode length:

python convert_unitree_json_to_lerobot.py \
    ... \
    --min_episode_length 30   # frames, default is 60

"Action shape mismatch (expected 28, got 14)"

code
Cause: wrong --robot_type — G1 without Dex3 has 14 arm joints only
Fix: check your hardware

# G1 with Dex3 (3-finger dex hands): --robot_type Unitree_G1_Dex3  → 28 joints
# G1 with standard gripper:          --robot_type Unitree_G1        → 14 joints

"CUDA not found" when running hdf5_to_rlds

code
Cause: TensorFlow uses GPU if available, but it's not required
Fix: force CPU (3x slower but works)

CUDA_VISIBLE_DEVICES="" python hdf5_to_rlds.py ...

Next: Fine-tune unifolm-vla from Qwen2.5-VL-7B — including single-GPU LoRA workaround.


References

  • unitree_IL_lerobot GitHub
  • LeRobot documentation
  • RLDS format spec

Tool recommendations

VLA train/deploy stack

Train on cloud/workstation, then deploy optimized models to Jetson or the robot computer.

Cloud GPU for VLA / policy training Use for imitation learning, diffusion policies, RL, and robotics model fine-tuning. View cloud GPU → NVIDIA Jetson Orin NX / Orin Nano Edge deployment hardware for perception, logging, and optimized inference. View Jetson → Hugging Face / robotics dataset hosting Host datasets, checkpoints, and model cards for cleaner LeRobot/VLA workflows. View platform →

Related posts

  • Post 2: Data collection with xr_teleoperate
  • Post 4: Fine-tune unifolm-vla from Qwen2.5-VL-7B
  • VLA + WBC repos landscape 2025-2026
NT

Nguyễn Anh Tuấn

Robotics & AI Engineer. Building VnRobo — sharing knowledge about robot learning, VLA models, and automation.

Explore VnRobo

Fleet MonitoringROS 2 IntegrationAMR Solutions
unifolm-vla-g1-series — Part 3/5
← unifolm-vla + Unitree G1 (Post 2): collecting data with xr_teleoperate + Meta Quest 3unifolm-vla + Unitree G1 (Post 4): fine-tuning from Qwen2.5-VL-7B — 8-GPU and single-GPU LoRA →

Related Posts

Tutorial
unifolm-vla + Unitree G1 (Post 5): deploy inference server, SSH tunnel, and parallel locomotion
humanoidvladeployPart 5
humanoid

unifolm-vla + Unitree G1 (Post 5): deploy inference server, SSH tunnel, and parallel locomotion

Final series post: start the FastAPI inference server, connect G1 via SSH tunnel, send action commands, run arm VLA and locomotion simultaneously — with safety checklist and debug guide for common real-hardware failures.

6/7/20267 min read
NT
Tutorial
unifolm-vla + Unitree G1 (Post 4): fine-tuning from Qwen2.5-VL-7B — 8-GPU and single-GPU LoRA
humanoidvlafine-tuningPart 4
humanoid

unifolm-vla + Unitree G1 (Post 4): fine-tuning from Qwen2.5-VL-7B — 8-GPU and single-GPU LoRA

Fine-tune unifolm-vla from the public Qwen2.5-VL-7B-Instruct checkpoint (since Unifolm-VLM-0 is not public) — covering the official 8-GPU DeepSpeed approach and a single-GPU QLoRA workaround for beginners.

6/6/20267 min read
NT
Tutorial
unifolm-vla + Unitree G1 (Post 2): collecting data with xr_teleoperate + Meta Quest 3
humanoidvladata-collectionPart 2
humanoid

unifolm-vla + Unitree G1 (Post 2): collecting data with xr_teleoperate + Meta Quest 3

Step-by-step guide to setting up xr_teleoperate with Meta Quest 3, connecting G1, recording teleoperation demos, and collecting high-quality data for VLA training on real hardware.

6/2/20267 min read
NT
VnRobo logoVnRobo logo

AI infrastructure for next-generation industrial robots.

Product

  • Features
  • Pricing
  • Knowledge Base
  • Services

Company

  • About Us
  • Blog
  • Contact

Legal

  • Privacy Policy
  • Terms of Service

© 2026 VnRobo. All rights reserved.

Made with♥in Vietnam