mirror of
https://github.com/huggingface/lerobot.git
synced 2026-08-08 09:29:54 +00:00
fix(g05): pass dataset count stat through embodiment projection
LeRobot dataset stats include a scalar per-feature sample count that is not a per-dimension statistic, so projecting it to the embodiment index map raised a width-mismatch ValueError for every real dataset. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -679,6 +679,11 @@ def _project_stats(
|
||||
projected_stats: dict[str, torch.Tensor] = {}
|
||||
for stat_name, raw_value in stats.items():
|
||||
value = torch.as_tensor(raw_value)
|
||||
if stat_name == "count":
|
||||
# LeRobot dataset stats carry a scalar sample count that is not
|
||||
# a per-dimension statistic; pass it through unprojected.
|
||||
projected_stats[stat_name] = value
|
||||
continue
|
||||
if value.shape[-1] != len(index_maps[feature_name]):
|
||||
raise ValueError(
|
||||
f"{feature_name}.{stat_name} has width {value.shape[-1]}, "
|
||||
|
||||
Reference in New Issue
Block a user