Library to transform ONNX models to PyTorch
Top 82.6% on sourcepulse
This library transforms ONNX models into PyTorch representations, enabling users to leverage PyTorch's backend and features for neural network manipulation. It is particularly useful for researchers and developers who need to convert pre-trained models from ONNX format to PyTorch for further analysis, modification, or integration into PyTorch-based pipelines.
How It Works
The library parses an ONNX model and reconstructs an equivalent PyTorch model layer by layer. It maps ONNX operators to their corresponding PyTorch modules, handling the graph traversal and dependency management to ensure accurate conversion. This approach allows for seamless integration with the PyTorch ecosystem.
Quick Start & Requirements
pip install onnx2pytorch
onnxruntime>=1.5.0
, set export KMP_DUPLICATE_LIB_OK=True
in .bashrc
or .zshrc
../download_fixtures.sh
.Highlighted Details
debug=True
) allows comparison of PyTorch and ONNX Runtime activations to pinpoint conversion discrepancies.Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
experimental=True
in ConvertModel
is required to bypass this assertion.8 months ago
Inactive