Unity ML-Agents PPO 训练的 Pyramids 金字塔导航策略(2×512 MLP,172 维向量观测:raycast 感知 + 目标 one-hot),本仓将其适配到华为昇腾 NPU 真实跑通推理。
/opt/atomgit/.hfhome/ppo-Pyramids/agent.pt(ML-Agents Pyramids/checkpoint.pt,global_step 3,778,906,8.7 MB,权重不入库)network_body._body_endoder.seq_layers.0.weight 形状 (512, 172))action_model._discrete_distribution.branches.0.weight 形状 (5, 512))PyramidsPolicy(含 ML-Agents 元信息 buffer)+ load_state_dict(strict=True) → missing=0 / unexpected=0 / mismatched=0合成 8 组 172 维 Pyramids 观测(linspace(-1,1) 覆盖 raycast 距离/方向取值域,含全零基线):
| 指标 | 值 |
|---|---|
| 动作输出 | [2, 4, 4, 4, 1, 1, 1, 1](不同感知输入 → 不同导航动作) |
| 动作多样性 | 3 种 / 8 组观测(非恒定,策略真实响应观测) |
| top-1 置信度 | 0.863(softmax 平均) |
| 输入 | p50 | avg |
|---|---|---|
| 1×172 观测, fp32 | 0.148 ms | 0.150 ms |
export PYTHONPATH=/tmp/fixpkgs # 先于 set_env.sh
source /usr/local/Ascend/cann-8.5.1/set_env.sh
export ASCEND_RT_VISIBLE_DEVICES=0
python inference.py