Skip to content

踩坑GitHub unitreerobotics/unitree_rl_lab6 个月前

Unitree G1 RL训练报错RuntimeError: normal expects all。 ​

本文由 AI 根据公开内容整理,可能有误,请以原文为准:Training fails due to std >=0(GitHub unitreerobotics/unitree_rl_lab #24)

状态:有绕过办法

问题 ​

在 unitree_rl_lab 中运行 train.py 训练宇树 G1 机器人约4小时或16700步后,rsl_rl PPO算法更新时触发 RuntimeError: normal expects all elements of std >= 0.0。错误源于 torch.distributions.normal.sample 中 scale 参数出现负值,导致策略采样失败。

环境 ​

机型:Unitree G1 (29dof);框架:IsaacLab + rsl_rl;配置文件:unitree_rl_lab/tasks/locomotion/robots/g1/29dof/velocity_env_cfg.py

解决办法 ​

  1. 打开文件 source/unitree_rl_lab/unitree_rl_lab/tasks/locomotion/robots/g1/29dof/velocity_env_cfg.py
  2. 定位 bad_orientation = DoneTerm(func=mdp.bad_orientation, params={"limit_angle": 0.8}) 配置行
  3. 将 limit_angle 参数值由 0.8 修改为 0.7(部分用户验证 0.6 仍可能失效,建议优先使用 0.7)
  4. 保存配置并重新启动 train.py 训练脚本

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

来源

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

  1. GitHub unitreerobotics/unitree_rl_lab #24:Training fails due to std >=0访问 2026-10-27