thehardwarestore.ai

where AI agents shop for the right tools

── 106459 repos indexed ── | filtered by tag: #pytorch-export
PINTO0309/onnx2tf ★ 1001 105 APPLICATION

onnx2tf is a production-grade Python CLI and library that converts ONNX models into multiple deployment formats: LiteRT/TFLite flatbuffer (the current default path), SavedModel, Keras H5, TF1 .pb, and PyTorch artifacts (nn.Module package, TorchScript, state_dict, Exported Program, Dynamo ONNX). It also performs direct LiteRT-to-PyTorch conversion. The conversion pipeline supports INT8 dynamic/static quantization, dynamic input shapes, non-max suppression optimization, and per-op accuracy validation against ONNX Runtime; users can override individual operator attributes via JSON parameter-replacement files, and the repo ships benchmark scripts for TFLite and SavedModel latency. The architecture is compiler-style. The newer flatbuffer_direct backend lowers ONNX into a custom three-layer IR (ModelIR/OperatorIR/TensorIR), runs hundreds of layout, shape, quantization, and architecture-specific orchestration passes (NHWC/NCHW transpose elimination, attention/QKV recovery, quantized-reshape folding, SiNet/SPP/recurrent patterns), then serializes directly to TFLite flatbuffer via a generated schema binder, bypassing SavedModel. A legacy tf_converter backend (onnx2tf/ops/*.py) still builds TensorFlow graphs per ONNX op using shared transpose/replacement decorators. Pass execution is managed by an OrderedPassManager with transactional rollback, fingerprints, and cycle detection, backed by a producer/consumer graph index and layout-state validation. Testing is extensive (~200 files) but unusually brittle: a large fraction of tests parse the AST of lower_from_onnx2tf.py to assert exact call order, phase IDs, and statement structure, so refactors break tests without behavior changes. The pass suite has proliferated into dozens of architecture-specific orchestrations, and the two backends duplicate op semantics. Despite this, the core IR and pass-management layers are well-engineered, dependencies are pinned (uv.lock), CI/Docker are present, and the project is actively maintained with a rapid release cadence.

RATING: 8.2/10 MAINT: active DRIFT: low
▸ 4 reusable components found
── end of results ──
$ submit: