Feature: add a read-only normalization compatibility report
When fine-tuning pi0 or pi0.5 on a custom robot dataset, users must choose between computing new normalization statistics and reusing statistics from a pretrained checkpoint. Reusing checkpoint statistics can help when the robot and action-space definition match pretraining, but OpenPI currently does not provide a read-only way to measure whether the configured statistics are compatible with the post-transform training data.
A mismatch can remain syntactically valid while producing severe clipping, out-of-distribution normalized values, or unstable training. Related reports include #773, #814, and #832.
Proposed feature
Add a small read-only normalization compatibility report, either as a new script or as an optional mode of scripts/compute_norm_stats.py, depending on the maintainers’ preferred interface.
Example:
uv run scripts/check_norm_stats.py
--config-name pi05_droid_finetune
--max-frames 5000
The command would use OpenPI’s existing configuration and data pipeline so values are inspected after the configured repack and data transforms. It would then compare sampled state and actions against the normalization statistics selected by the configuration.
Example output:
actions data shape: (..., 8) norm-stat shape: (8,) non-finite values: 0 near-constant dimensions: [7] outside checkpoint q01-q99: 17.4% largest mismatch: dimension 4 result: WARNING
state data shape: (..., 8) norm-stat shape: (8,) non-finite values: 0 outside checkpoint q01-q99: 2.1% result: PASS
The initial checks would be intentionally limited to:
Missing keys and incompatible final dimensions NaN and Inf values Near-zero-variance dimensions Fraction of sampled values outside the configured q01–q99 range Per-dimension summaries identifying the largest mismatch
Thresholds could initially be informational rather than blocking training.
Non-goals No mutation, filtering, or rewriting of datasets No automatic choice between pretrained and newly computed statistics No changes to the training path or normalization math No general video, timestamp, or dataset-quality validation No requirement to run the model or a robot Implementation and tests
I would be happy to implement this after confirming the preferred interface. The implementation could reuse the existing configuration, data-loader, and NormStats utilities while keeping the comparison logic in small pure functions.
Proposed tests:
Matching statistics produce a passing report Dimension mismatches are reported clearly NaN and Inf values are counted Constant dimensions are identified Out-of-range fractions are correct for a synthetic batch The command remains read-only
Would maintainers prefer this as a separate check_norm_stats.py script or as a --compare-with-configured-stats mode in compute_norm_stats.py?
Source: Physical-Intelligence/openpi