debug: 归一化
This commit is contained in:
@@ -164,24 +164,24 @@ def main(cfg: DictConfig):
|
||||
dataset_stats = None
|
||||
try:
|
||||
dataset_dir = cfg.data.get('dataset_dir', 'roboimi/demos/dataset/sim_transfer')
|
||||
stats_path = Path(dataset_dir) / 'data_stats.pkl'
|
||||
stats_path = Path(dataset_dir) / 'dataset_stats.pkl'
|
||||
|
||||
if stats_path.exists():
|
||||
with open(stats_path, 'rb') as f:
|
||||
stats = pickle.load(f)
|
||||
|
||||
# 扁平化stats字典(嵌套结构→扁平结构)以匹配NormalizationModule的期望格式
|
||||
dataset_stats = {
|
||||
'normalization_type': cfg.data.get('normalization_type', 'gaussian'),
|
||||
'action_mean': stats['action']['mean'].tolist(),
|
||||
'action_std': stats['action']['std'].tolist(),
|
||||
'action_min': stats['action']['min'].tolist(),
|
||||
'action_max': stats['action']['max'].tolist(),
|
||||
'qpos_mean': stats['qpos']['mean'].tolist(),
|
||||
'qpos_std': stats['qpos']['std'].tolist(),
|
||||
'qpos_min': stats['qpos']['min'].tolist(),
|
||||
'qpos_max': stats['qpos']['max'].tolist(),
|
||||
'action_mean': stats['action_mean'].tolist(),
|
||||
'action_std': stats['action_std'].tolist(),
|
||||
'action_min': stats['action_min'].tolist(),
|
||||
'action_max': stats['action_max'].tolist(),
|
||||
'qpos_mean': stats['qpos_mean'].tolist(),
|
||||
'qpos_std': stats['qpos_std'].tolist(),
|
||||
'qpos_min': stats['qpos_min'].tolist(),
|
||||
'qpos_max': stats['qpos_max'].tolist(),
|
||||
}
|
||||
log.info(f"✅ 数据集统计信息加载完成 (归一化: {dataset_stats['normalization_type']})")
|
||||
log.info(f"✅ 数据集统计信息加载完成 (归一化: {cfg.agent.normalization_type})")
|
||||
else:
|
||||
log.warning(f"⚠️ 统计文件未找到: {stats_path}")
|
||||
log.warning("⚠️ 推理时动作将无法反归一化!")
|
||||
|
||||
Reference in New Issue
Block a user