#4649·lerobot

migrate_policy_normalization emits empty config.json and does not copy model weights

Author: DanMo661Created Sep 15, 2026Updated Sep 16, 2026
Labelspoliciesconfigurationprocessor

Description

python -m lerobot.processor.migrate_policy_normalization --pretrained-path <hub-or-dir> --output-dir <dir> (lerobot 0.6.1) produces an output directory that cannot be loaded as-is:

  1. config.json is written empty (0 bytes) — every subsequent load dies with a draccus JSONDecodeError: Expecting value: line 1 column 1,
  2. model.safetensors is not copied to the output dir — only the four processor files land there:
    config.json                                0 bytes
    policy_postprocessor.json                 658
    policy_postprocessor_step_0_unnormalizer_processor.safetensors
    policy_preprocessor.json                 1143
    policy_preprocessor_step_3_normalizer_processor.safetensors

The migration log itself claims success end-to-end (Saving model to <dir>...).

Workaround

Assemble the directory manually — processor files from the migration output, config.json + model.safetensors from the HF snapshot (e.g. ~/.cache/huggingface/hub/models--lerobot--diffusion_pusht/snapshots/<rev>/). After that, from_pretrained/make_policy work fine on the assembled dir.

Reproduction

bash
python -m lerobot.processor.migrate_policy_normalization     --pretrained-path lerobot/diffusion_pusht --output-dir /tmp/migrated
ls -la /tmp/migrated   # config.json = 0 bytes, no model.safetensors
python -c "from lerobot.configs.policies import PreTrainedConfig; PreTrainedConfig.from_pretrained('/tmp/migrated')"
# JSONDecodeError

Expected

  • config.json copied (or re-serialized) with valid contents,
  • model.safetensors (with the cleaned state dict) written to the output dir.

Context: hit while migrating lerobot/diffusion_pusht per the 0.6 upgrade path; the same gap is mentioned briefly in #4647. Happy to PR a fix if maintainers confirm the intended output layout.

Env: lerobot 0.6.1, Ubuntu 24.04.