Skip to content

TypeError in compute_norm_stats.py with latest torch / HF Hub / lerobot versions #561

@cpa2001

Description

@cpa2001

Description

Running

uv run scripts/compute_norm_stats.py --config-name pi0_fast_libero

now fails with a TypeError when lerobot.common.datasets.utils.check_timestamps_sync calls
torch.stack(hf_dataset["timestamp"]).

Traceback

Some kwargs in processor config are unused … (truncated)

Traceback (most recent call last):
  File "/vePFS/vla/shared/github/openpi/scripts/compute_norm_stats.py", line 116, in <module>
    tyro.cli(main)
  ...
  File "/vePFS/vla/shared/github/openpi/.venv/lib/python3.11/site-packages/lerobot/common/datasets/utils.py", line 410, in check_timestamps_sync
    timestamps = torch.stack(hf_dataset["timestamp"])
TypeError: stack(): argument 'tensors' (position 1) must be tuple of Tensors, not Column

The same command worked fine on the exact dataset and config two months ago.

Environment

Item Value
OS Ubuntu 22.04
Python 3.11 (managed by uv)
openpi commit HEAD (rev="0cf864870cf29f4738d3ade893e6fd13fbd7cdb5")
torch 2.7.1
huggingface-hub 0.33.2
datasets 4.0.0
lerobot 0.1.0

Steps to Reproduce

  1. Fresh clone of openpi
  2. uv pip install -e .
  3. Run the command above with default configs

Expected Behaviour

Script completes and writes normalisation statistics (previous behaviour).

Hypothesis

  • hf_dataset["timestamp"] used to return a list/tuple of tensors; it now returns a datasets.Column, which torch.stack rejects.
  • Behaviour change likely introduced by one (or more) of:
    • PyTorch 2.3.x
    • huggingface-hub ≥ 0.22 / datasets ≥ 2.20
    • lerobot new commit

Request

  1. Bug fix / workaround – guidance on the correct API call or a patch for check_timestamps_sync.
  2. Reference environment – could the repo ship a stricter, version-pinned environment file?
    Below is a draft pyproject.toml snippet that matches the last working versions on my side.
[project]
name = "openpi"
version = "0.1.0"
requires-python = ">=3.10,<3.12"

[project.dependencies]
torch = ">=2.2.0,<2.3.0"
huggingface-hub = ">=0.21.0,<0.23.0"
datasets = ">=2.19.0,<2.20.0"
lerobot = ">=0.5.0,<0.6.0"
tyro = "0.6.1"
numpy = "^1.26"
# … other dependencies

Happy to adjust versions or open a PR once the canonical set is confirmed.


Thanks for your time! Please let me know if additional logs or tests would help.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions