A PaddlePaddle New IR (PIR) to ONNX model converter, written in Rust.
Converts PaddlePaddle inference models (inference.json + inference.pdiparams) to the ONNX format.
Download from GitHub Releases.
pip install p2ocargo install p2ogit clone https://github.com/greatv/p2o.git
cd p2o
cargo build --releasep2o <model.json> <model.pdiparams> <output.onnx> [--opset 17] [--strict]| Argument | Description |
|---|---|
model.json |
Path to the PaddlePaddle .json model file |
model.pdiparams |
Path to the PaddlePaddle .pdiparams weight file |
output.onnx |
Path to the output .onnx model file |
--opset <N> |
Target ONNX opset version (≥ 10, default: 17) |
--strict |
Reject lossy conversions (e.g. multinomial → ArgMax) |
p2o inference_models/PP-OCRv5_server_det_infer/inference.json \
inference_models/PP-OCRv5_server_det_infer/inference.pdiparams \
output.onnx --opset 17