LeRobot documentation
Configuration
Configuration
LeRobot configuration is plain dataclasses parsed by draccus, so every
field is settable from the CLI. TrainPipelineConfig is the top-level object for lerobot-train.
Polymorphic configs (policies, robots, environments) use draccus.ChoiceRegistry: a subclass registers
itself with @register_subclass("name") and is then selectable by that name on the command line.
TrainPipelineConfig
class lerobot.configs.train.TrainPipelineConfig
< source >( dataset: DatasetConfigenv: lerobot.envs.configs.EnvConfig | None = Nonepolicy: lerobot.configs.policies.PreTrainedConfig | None = Nonereward_model: lerobot.configs.rewards.RewardModelConfig | None = Noneoutput_dir: pathlib.Path | None = Nonejob_name: str | None = Noneresume: bool = Falseseed: int | None = 1000cudnn_deterministic: bool = Falsenum_workers: int = 4batch_size: int = 8prefetch_factor: int = 4persistent_workers: bool = Truedataloader_multiprocessing_context: str | None = 'spawn'steps: int = 100000env_eval_freq: int = 20000log_freq: int = 200eval_steps: int = 0max_eval_samples: int = 0tolerance_s: float = 0.0001save_checkpoint: bool = Truesave_freq: int = 20000checkpoint_format: CheckpointFormat = <CheckpointFormat.SAFETENSORS: 'safetensors'>use_policy_training_preset: bool = Trueoptimizer: lerobot.optim.optimizers.OptimizerConfig | None = Nonescheduler: lerobot.optim.schedulers.LRSchedulerConfig | None = Noneparallelism: ParallelismConfig = <factory>accelerator: AcceleratorConfig = <factory>eval: EvalConfig = <factory>ema: EMAConfig = <factory>wandb: WandBConfig = <factory>peft: lerobot.configs.default.PeftConfig | None = Nonejob: JobConfig = <factory>save_checkpoint_to_hub: bool = Falsesample_weighting: lerobot.utils.sample_weighting.SampleWeightingConfig | None = Nonerename_map: dict = <factory> )
PreTrainedConfig
class lerobot.configs.PreTrainedConfig
< source >( n_obs_steps: int = 1input_features: dict[str, lerobot.configs.types.PolicyFeature] | None = <factory>output_features: dict[str, lerobot.configs.types.PolicyFeature] | None = <factory>device: str | None = Noneuse_amp: bool = Falseuse_peft: bool = Falsepush_to_hub: bool = Truerepo_id: str | None = Noneprivate: bool | None = Nonetags: list[str] | None = Nonelicense: str | None = Nonepretrained_path: pathlib.Path | None = Nonepretrained_revision: str | None = None )
Parameters
- n_obs_steps — Number of environment steps worth of observations to pass to the policy (takes the current step and additional steps going back).
- input_features — A dictionary defining the PolicyFeature of the input data for the policy. The key represents the input data name, and the value is PolicyFeature, which consists of FeatureType and shape attributes.
- output_features — A dictionary defining the PolicyFeature of the output data for the policy. The key represents the output data name, and the value is PolicyFeature, which consists of FeatureType and shape attributes.
- normalization_mapping — A dictionary that maps from a str value of FeatureType (e.g., “STATE”, “VISUAL”) to a corresponding NormalizationMode (e.g., NormalizationMode.MIN_MAX)
Base configuration class for policy models.
DatasetConfig
class lerobot.configs.DatasetConfig
< source >( repo_id: strrepo_type: str = 'dataset'root: str | None = Noneepisodes: list[int] | None = Noneexclude_episodes: list[int] | None = Noneimage_transforms: ImageTransformsConfig = <factory>revision: str | None = Noneuse_imagenet_stats: bool = Truevideo_backend: str = <factory>return_uint8: bool = Falsedepth_output_unit: str = 'mm'streaming: bool = Falseeval_split: float = 0.0 )
EvalConfig
class lerobot.configs.EvalConfig
< source >( n_episodes: int = 50batch_size: int = 0use_async_envs: bool = Truerecording: bool = Falserecording_repo_id: str | None = Nonerecording_private: bool = False )
WandBConfig
class lerobot.configs.WandBConfig
< source >( enable: bool = Falsedisable_artifact: bool = Falseproject: str = 'lerobot'entity: str | None = Nonenotes: str | None = Nonerun_id: str | None = Nonemode: str | None = Noneadd_tags: bool = True )