sio4onnx
Simple tool to change the INPUT and OUTPUT shape of ONNX.
What it is and what it does
sio4onnx is a lightweight utility for modifying the declared input and output shapes of ONNX model files. It works both as a command-line tool and as a Python library, accepting either a file path or an in-memory ONNX graph, then rewriting the shape metadata for specified input and output nodes. You can use fixed dimensions, symbolic names like 'H' and 'W', or dynamic markers like '-1' to represent variable axes.
The package is useful when you have a pre-trained ONNX model with fixed shapes but need to adapt it for different batch sizes, image resolutions, or sequence lengths without retraining. It modifies only the shape declarations in the model graph, not the underlying weights or operations. The tool has no external runtime dependencies and supports Python 3.6 and later, making it straightforward to integrate into model preprocessing pipelines.
Use it for:
- Adapt a fixed-batch ONNX model to accept variable batch sizes for inference on different hardware or deployment scenarios.
- Change image input dimensions in a computer vision model to match production inference requirements.
- Prepare an ONNX model for deployment on edge devices by modifying input shapes to match device constraints.
- Batch-process multiple ONNX files to standardize their input/output shape signatures across a model zoo.
- Use symbolic dimension names in place of hard-coded values to enable downstream tools to infer shapes dynamically.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Modifies the input and output shapes of ONNX model files, allowing you to adapt pre-trained models to different batch sizes, dimensions, or symbolic shape parameters via CLI or Python API.
Yes, if you work with ONNX models and need to adjust their input/output shapes for deployment or inference. The package is lightweight, dependency-free, and permissively licensed. Maintenance is aging (last release 500 days ago), but the repository is not archived and the tool solves a narrow, stable problem unlikely to require frequent updates. Suitable for production use in model preprocessing pipelines.
Install
sio4onnx on PyPI
pip
pip install sio4onnxuv
uv add sio4onnxpoetry
poetry add sio4onnxInstalling sio4onnx
Before you install
Installs cleanly with no runtime dependencies. Maintenance is aging—last release was 500 days ago—but the repository remains active and the package supports current Python versions.
License in practice
MIT License permits commercial and private use with minimal restrictions, making it safe to integrate into proprietary workflows.
Quickstart
pip install sio4onnx
from sio4onnx import io_change
io_changed_graph = io_change(
input_onnx_file_path="model.onnx",
output_onnx_file_path="model_reshaped.onnx",
input_names=["input_1"],
input_shapes=[[1, 3, "H", "W"]],
output_names=["output_1"],
output_shapes=[[1, "boxes", 4]]
)
Verify before relying
- Whether symbolic dimension names are fully preserved through inference pipelines downstream.
- Support for dynamic shape inference or validation after modification.
- Compatibility with all ONNX opset versions or any known limitations.
Package facts
| License | MIT License (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 500 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 82,754/month — #14,137 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sio4onnx-1.0.3-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
soc4onnxChanges the opset version of an ONNX model…
permissive · top 15,000 on PyPI
ssi4onnxInfers and fills missing tensor shape…
permissive · top 15,000 on PyPI
scc4onnxConverts ONNX model input tensor dimensions and…
permissive · top 15,000 on PyPI
soa4onnxAdds or modifies output nodes in ONNX model…
permissive · top 15,000 on PyPI
sbi4onnxModifies ONNX model files to initialize or…
permissive · top 15,000 on PyPI
sod4onnxsod4onnx removes specified output operations…
permissive · top 15,000 on PyPI
sam4onnxRewrites attributes and constants in ONNX model…
permissive · top 15,000 on PyPI
sng4onnxAutomatically generates and assigns operation…
permissive · top 15,000 on PyPI
sor4onnxRenames input, output, and operator nodes in…
permissive · top 15,000 on PyPI
snd4onnxRemoves specified nodes from ONNX model graphs…
permissive · top 15,000 on PyPI