Skip to main content

Install LeRobot

There are two ways to get a runtime environment for LeRobot v0.5.0: use a prebuilt GPU image, or install from the official source locally. Use the image for training only; use the source install to modify policy configuration, debug data mapping, or connect a custom robot interface.

Roles and Prerequisites​

Roles​

RoleFocus
Algorithm engineerSource installation, policy configuration, dataset loading
Training operationsGPU images, container runtime, mounts, and ports

Prerequisites​

ItemRequirement
Operating systemThe source installation uses Ubuntu 22.04 as an example
PythonThe source installation uses Python 3.12 or later; the official v0.5.0 declares requires-python as >=3.12
GPUTraining requires an NVIDIA GPU and the NVIDIA container runtime
Video decodingRequires ffmpeg; the default official decoding backend TorchCodec depends on it, and unsupported platforms fall back to pyav
Build toolsgit, git-lfs, build-essential, cmake, ninja-build, python3-dev, and the FFmpeg development libraries
DiskRoom for datasets, dependencies, and checkpoints

Procedure​

  1. Confirm that the host can access the GPU inside a container.
docker run --rm --gpus all nvidia/cuda:12.2.2-base-ubuntu22.04 nvidia-smi
  1. When using the image, pull and enter the platform LeRobot training image (default lerobot:latest), and mount the dataset and output directories as separate volumes.
docker run --rm -it --gpus all --shm-size 16g \
-v /path/to/lerobot_dataset:/data/input \
-v /path/to/output:/outputs \
lerobot:latest \
bash
  1. Check the training entry point inside the container.
/lerobot/.venv/bin/lerobot-train --help
  1. For a source installation, install the system dependencies first.
sudo apt-get update
sudo apt-get install -y \
git git-lfs curl build-essential cmake pkg-config ninja-build \
ffmpeg python3-dev \
libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev \
libswscale-dev libswresample-dev libavfilter-dev
  1. Create a Python 3.12 environment.
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip setuptools wheel
  1. Install LeRobot v0.5.0 from the official tag.
git clone https://github.com/huggingface/lerobot.git
cd lerobot
git checkout v0.5.0
pip install -e ".[all]"
  1. Verify the installation. Start training only after all three commands return help output.
lerobot-train --help
lerobot-dataset-viz --help
lerobot-info

Verification​

Verification itemMethodPass criteria
GPU visibleRun nvidia-smi inside the containerLists the GPU model and driver
Training entry point availableRun lerobot-train --helpPrints parameter help with no import errors
Visualization entry point availableRun lerobot-dataset-viz --helpPrints parameter help
Dataset readableLoad the dataset root with LeRobotDatasetReturns the frame count and episode count with no exceptions
Video decodableOpen a dataset that contains MP4Frames decode

Error Handling​

SymptomPossible causeResolutionOwner
Dependency resolution failedPython version below the declared requirementUse Python 3.12 or laterAlgorithm engineer
Video read failedffmpeg is missingInstall ffmpeg and reinstall the dependenciesAlgorithm engineer
GPU not visible in the containerThe NVIDIA container runtime is missing, or --gpus is not setInstall nvidia-container-toolkit and add --gpus all at runtimeTraining operations
Slow image pullRestricted network access to Docker HubUse the image address configured for the deploymentTraining operations
PyTorch CUDA wheel download failedThe CUDA version does not match the driverInstall the matching version from the official PyTorch index first, then install LeRobotAlgorithm engineer
Dataset root not foundWrong mount levelMount the directory that contains meta/info.json and point --dataset.root to itAlgorithm engineer