Skip to content

踩坑GitHub huggingface/lerobot16 天前

from_pretrained 未回填路径导致归一化为空 ​

本文由 AI 根据公开内容整理,可能有误,请以原文为准:PreTrainedConfig.from_pretrained() leaves pretrained_path=None → silently builds untrained processor pipeline (blind policy)(GitHub huggingface/lerobot #4647)

状态:有绕过办法

问题 ​

PreTrainedConfig.from_pretrained(path) 返回的配置中 pretrained_path 为 None,make_pre_post_processors 未加载 safetensors 统计,构建出空归一化流水线;策略无报错但推理近似随机,PushT 奖励接近 0。

环境 ​

LeRobot;lerobot/diffusion_pusht 与 PushT;另有 0.4.4、ACT/Diffusion Policy、自定义 MuJoCo state-only 数据集;main 0.6.x 提到。

解决办法 ​

  1. 在 from_pretrained 后手动设置 cfg.pretrained_path = "路径",再调用 make_pre_post_processors(policy_cfg=cfg, pretrained_path=cfg.pretrained_path)。
  2. 或在推理时用数据集统计重建处理器:调用 make_pre_post_processors(policy_cfg=policy.config, dataset_stats=ds.meta.stats)。
  3. 原文提到修复 PR #4648 会让程序化路径自动加载相邻的 stats safetensors。

讨论原作者:@DanMo661 等,版权归原作者所有。

来源

本页事实对应的公开页面,以原文为准。

  1. GitHub huggingface/lerobot #4647:PreTrainedConfig.from_pretrained() leaves pretrained_path=None → silently builds untrained processor pipeline (blind policy)访问 2026-10-12