fix(pybot×actpred): 审计修复 7 项——Hailo 部署链语义对齐 + NaN 安全
P1-1: export_deploy.py forward() 从硬编码 3 帧改为 *inputs 动态解析
P1-2: hailo_infer.py 补 predict_delta 支持(残差模式 + --ckpt 自动检测)
P1-3: pybot _load_predictor 自动查找 pred_token.npy/action_stats.npy/
companion checkpoint,恢复 Hailo 推理训练语义
P1-4: pretrain_mt.py random_images 每 batch 重新生成噪声,防 BN 退化
P2-1: predict.py/hailo_infer.py/robot.py 三层 NaN/Inf 防线
P2-3: recorder.py imu_dim 默认 8→0,避免外部直接使用时形状错误
P2-5: _npu_test.py imu_dim 移到函数定义前,消除执行顺序依赖
This commit is contained in:
1 parent
7ec8c9d0e9
commit
aa271e395a
9 files changed
+109
-13
No files matched your search
@@ -55,6 +55,7 @@ model = ActionPredictor(cfg.model, cfg.data, pretrained=False)
|
||||
model.load_state_dict(ck["model_state_dict"])
|
||||
model.eval()
|
||||
pred_learned = model.pred_token.data.unsqueeze(1).numpy() # (1,1,1,d)
|
||||
imu_dim = cfg.data.imu_dim
|
||||
|
||||
# 归一化模型:torch 参考在喂入前 z-score;HailoPredictor 传 stats_path
|
||||
# 由封装内部归一化(hist_real/hist_zero 保持原始值,避免双重归一化)
|
||||
@@ -101,7 +102,6 @@ def torch_pred(imgs, hist, use_learned_pred=True, imu=None):
|
||||
|
||||
|
||||
# R2 方案一:imu_dim>0 时每步传原始姿态(HailoPredictor 内部归一化)
|
||||
imu_dim = cfg.data.imu_dim
|
||||
imu_real = np.array([5.0, -3.0] + [0.0] * 6, dtype=np.float32)
|
||||
|
||||
with HailoPredictor(HEF_PATH, stats_path=stats_path) as p:
|
||||
|
||||
Reference in new issue
Block a user