You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/Users/xxxx/miniconda3/envs/py310/lib/python3.10/site-packages/paddle/utils/cpp_extension/extension_utils.py:711: UserWarning: No ccache found. Please be aware that recompiling all source files may be required. You can download and install ccache from: https://github.com/ccache/ccache/blob/master/doc/INSTALL.md
91
85
warnings.warn(warning_message)
92
86
[Paddle2ONNX] Start parsing the Paddle model file...
93
-
[Paddle2ONNX] Use opset_version = 7for ONNX export.
87
+
[Paddle2ONNX] Use opset_version = 14for ONNX export.
94
88
[Paddle2ONNX] PaddlePaddle model is exported as ONNX format now.
95
-
2025-05-14 08:21:23 [INFO] Try to perform optimization on the ONNX model with onnxoptimizer.
96
-
2025-05-14 08:21:23 [INFO] ONNX model saved in models/PP-OCRv5_mobile_det/inference.onnx.
97
-
Paddle2ONNX conversion succeeded
98
-
Done
89
+
2025-05-26 11:20:46 [INFO] Try to perform constant folding on the ONNX model with Polygraphy.
90
+
[W] 'colored' module is not installed, will not use colors when logging. To enable colors, please install the 'colored' module: python3 -m pip install colored
91
+
[I] Folding Constants | Pass 1
92
+
[W] colored module is not installed, will not use colors when logging. To enable colors, please install the colored module: python3 -m pip install colored
93
+
[W] Inference failed. You may want to try enabling partitioning to see better results. Note: Error was:
94
+
[ONNXRuntimeError] : 1 : FAIL : /Users/runner/work/1/s/onnxruntime/core/graph/model.cc:182 onnxruntime::Model::Model(ModelProto &&, const PathString &, const IOnnxRuntimeOpSchemaRegistryList *, const logging::Logger &, const ModelOptions &) Unsupported model IR version: 11, max supported IR version: 10
95
+
[I] Total Nodes | Original: 925, After Folding: 612 | 313 Nodes Folded
96
+
[I] Folding Constants | Pass 2
97
+
[W] colored module is not installed, will not use colors when logging. To enable colors, please install the colored module: python3 -m pip install colored
98
+
[W] Inference failed. You may want to try enabling partitioning to see better results. Note: Error was:
99
+
[ONNXRuntimeError] : 1 : FAIL : /Users/runner/work/1/s/onnxruntime/core/graph/model.cc:182 onnxruntime::Model::Model(ModelProto &&, const PathString &, const IOnnxRuntimeOpSchemaRegistryList *, const logging::Logger &, const ModelOptions &) Unsupported model IR version: 11, max supported IR version: 10
100
+
[I] Total Nodes | Original: 612, After Folding: 612 | 0 Nodes Folded
101
+
2025-05-26 11:20:52 [INFO] ONNX model saved in models/PP-OCRv5_mobile_det/inference.onnx.
File "/Users/xxxx/miniconda3/envs/py310/lib/python3.10/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 550, in _create_inference_session
model = version_converter.convert_version(model, OPT_VERSION)
154
+
onnx.save(model, dist_path)
155
+
```
156
+
157
+
### 3. 模型推理验证
158
+
159
+
该部分主要是在RapidOCR项目中测试能否直接使用onnx模型。要点主要是确定模型前后处理是否兼容。从PaddleOCR config文件中比较[PP-OCRv4](https://github.com/PaddlePaddle/PaddleOCR/blob/549d83a88b7c75144120e6ec03de80d3eb9e48a5/configs/det/PP-OCRv4/PP-OCRv4_mobile_det.yml)和[PP-OCRv5 mobile det](https://github.com/PaddlePaddle/PaddleOCR/blob/549d83a88b7c75144120e6ec03de80d3eb9e48a5/configs/det/PP-OCRv5/PP-OCRv5_mobile_det.yml)文件差异:
0 commit comments