Registry / ai-ml / onnx-weekly

onnx-weekly

JSON →
library1.22.0.dev20260608pypypi✓ verified 84d ago

ONNX (Open Neural Network Exchange) is an open ecosystem for AI developers, providing an open standard format for machine learning models, including deep learning and traditional ML. It defines an extensible computation graph model, built-in operators, and standard data types to enable model interoperability across various frameworks. The `onnx-weekly` package offers continuous integration builds, providing early access to experimental features and allowing users to test upcoming changes ahead of official stable releases. The current version is 1.22.0.dev20260330, reflecting a rapid release cadence for development purposes.

pip install onnx-weekly
INSTALL
IMPORT
SIG · ONNX-WEEKLY
O
onnx-weekly
ai-mlpythonv1.22.0.dev20260608
Install
7.2s avg
Import
522ms
Disk
198MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.22.0.dev20260608 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
timeout
glibc
py 3.103.920 runs
installs and imports cleanly · install 7.2s · import 0.522s · 196MB
198MB installed
● package 198MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

onnx
import onnx
helper
from onnx import helper
checker
from onnx import checker
TensorProto
from onnx import TensorProto
parser
import onnx.parser
Used for parsing ONNX Script models.
shape_inference
import onnx.shape_inference
Provides utilities for shape and type inference in ONNX graphs.

This quickstart demonstrates how to programmatically construct a simple ONNX model (a linear regression: Y = X * A + B) using the `onnx.helper` module, and then validate it using `onnx.checker`. This illustrates the core functionality of defining and manipulating ONNX graphs.

import onnx from onnx import helper, checker, TensorProto # Create a simple ONNX graph for Y = X * A + B # Define inputs and outputs X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [None, 2]) A = helper.make_tensor_value_info('A', TensorProto.FLOAT, [2, 3]) B = helper.make_tensor_value_info('B', TensorProto.FLOAT, [3]) Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [None, 3]) # Create nodes (operators) # MatMul operation: C = X * A node_matmul = helper.make_node( 'MatMul', inputs=['X', 'A'], outputs=['C'], ) # Add operation: Y = C + B node_add = helper.make_node( 'Add', inputs=['C', 'B'], outputs=['Y'], ) # Create the graph graph_def = helper.make_graph( [node_matmul, node_add], # Nodes in the graph 'simple-linear-regression', # Graph name [X, A, B], # Graph inputs [Y], # Graph outputs ) # Create the model model_def = helper.make_model(graph_def, producer_name='onnx-example') # Check the model for validity try: checker.check_model(model_def) print("Model is valid!") except checker.ValidationError as e: print(f"Model is invalid: {e}") # Optionally, save the model # onnx.save(model_def, "simple_model.onnx")
Debug
Known issues
breakingThe `model hub integration` feature was removed in ONNX v1.21.0. If your workflow relied on this integration, you will need to update your code.
fix
Remove any dependencies on the defunct model hub integration. Consult ONNX documentation for alternative methods of accessing or managing models.
affects: >=1.21.0
gotchaThe `ml_dtypes` package became a direct dependency for ONNX versions >= 1.19.0. Users upgrading to these versions or using tools like `onnxruntime` with older `onnx` installations might encounter `ModuleNotFoundError` if `ml_dtypes` is not explicitly installed. This is particularly relevant when working with extended data types like FLOAT8.
fix
Ensure `ml_dtypes` is installed in your environment: `pip install ml_dtypes>=0.5.0`.
affects: >=1.19.0
gotchaThere's a common confusion between the `onnx` package (which defines the model format and provides utilities to build/manipulate ONNX graphs) and `onnxruntime` (which is the inference engine used to execute ONNX models efficiently). The `onnx-weekly` package only provides the `onnx` library.
fix
Understand the distinct roles: `onnx` for model definition/manipulation, `onnxruntime` for model execution. Install `onnxruntime` separately (`pip install onnxruntime`) for inference capabilities.
affects: All
gotchaONNX models are versioned by IR version and operator set (Opset) versions. Breaking changes to the IR format or operator semantics require version increments. Ensure that the ONNX Runtime or target inference environment you are using supports the specific Opset version of your ONNX model to avoid compatibility issues.
fix
Always check the Opset version of your exported ONNX model (`model_def.opset_import`) and confirm it is supported by your chosen ONNX Runtime version. Use `onnx.version_converter` if necessary to convert models to different opset versions.
affects: All
gotchaONNX models are serialized using Google's Protocol Buffers, which imposes a 2GB size limit on individual model files. Very large models may fail to serialize or load correctly.
fix
For models exceeding 2GB, consider splitting the model into smaller subgraphs, using external data fields (which store large tensors separately from the main protobuf file), or exploring alternative serialization methods if available.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'onnx'
The 'onnx' package (or 'onnx-weekly') is not installed in the active Python environment or there is a typo in the import statement.
fix
Ensure the correct package is installed using `pip install onnx-weekly` in your active Python environment. If you intended to use the stable release, use `pip install onnx` instead.
AttributeError: module 'onnx' has no attribute 'compose'
The 'onnx-weekly' package, being a development build, may have introduced API changes, or the specific function/attribute has been removed, renamed, or is not yet available in the version you have installed.
fix
Consult the official ONNX GitHub repository or documentation for the `onnx-weekly` branch to find the latest API, or consider using a stable `onnx` release if the specific experimental feature is not critical.
onnx-weekly has inconsistent version metadata
Installation fails because the package's metadata (e.g., version declared in `pyproject.toml` or `setup.py`) does not match the version expected by pip, often due to how development builds are packaged, or due to dependency conflicts with other installed packages like NumPy.
fix
Try installing with `pip install --no-binary :all: onnx-weekly` to force building from source, or explicitly specify compatible versions for dependencies like `numpy>=1.21.5`. Ensure your Python version is compatible (e.g., Python >=3.10 for recent `onnx-weekly` versions).
[ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Invalid rank for input: ... Got: X Expected: Y
The input data provided to the ONNX model (when running inference with ONNX Runtime) does not match the expected shape, data type, or name defined in the ONNX model's graph. This is a common issue when models are exported with one opset version and run with an incompatible ONNX Runtime version or incorrect input preparation.
fix
Validate the ONNX model's expected inputs (name, shape, and data type) using `session.get_inputs()` from `onnxruntime`. Adjust your input data (e.g., `numpy.ndarray`) to exactly match these specifications. Ensure the ONNX opset version of your model is compatible with your installed `onnxruntime` version.
RuntimeError: No such operator '...' in domain 'ai.onnx'
The ONNX model contains an operator (like `GridSample` or a custom operator) that is not supported by the ONNX operator set (opset) version targeted by the exporter or the installed ONNX Runtime version. This can happen with `onnx-weekly` as new operators or opset versions are frequently introduced and may not be universally supported yet.
fix
Verify the opset version of your ONNX model and the opsets supported by your `onnxruntime` version. If possible, re-export the model using an opset version known to be compatible with your `onnxruntime`, or update `onnxruntime` to a version that supports the required opset.
Upgrade
Version history
1.22.0.dev20260608latest on PyPI · released Jun 8, 2026
Audit
Dependencies
pythonrequiredRequired Python version
numpyrequiredFundamental package for numerical computing, used for tensor operations.
protobufrequiredONNX models are serialized using Google's Protocol Buffers.
typing-extensionsrequiredProvides backported and experimental type hints.
ml_dtypesrequiredIntroduced to support additional data types (e.g., float8) in NumPy arrays for the ONNX reference evaluator and helper functions. Required for ONNX versions >= 1.19.0.
Agent activity
12 hits · last 30 days
node
12
Resources
onnx-weekly — pip install onnx-weekly · libregistry