PaddlePaddle / PaddlePaddle/FastDeploy

转换ch_PP-OCRv3模型到rknn报错!!

Open
#5,595 0 comments 0 reactions 1 assignee View on GitHub

@juncaipeng is already working on this.

Since Dec 16, 2025.

Dominant language
Python
Stars
3.7k
Forks
756
Avg merge
19h 28m
Merged PRs (30d)
4

Description

我在进行模型转换中完全按照https://github.com/PaddlePaddle/FastDeploy/tree/release/1.1.0/examples/vision/ocr/PP-OCR/rockchip/python里的步骤进行,在执行命令:python rockchip/rknpu2_tools/export.py --config_path tools/rknpu2/config/ppocrv3_cls.yaml
--target_platform rk3588 时出错了:{'mean': [[127.5, 127.5, 127.5]], 'std': [[127.5, 127.5, 127.5]], 'model_path': './ch_ppocr_mobile_v2.0_cls_infer/ch_ppocr_mobile_v2.0_cls_infer.onnx', 'outputs_nodes': None, 'do_quantization': False, 'dataset': None, 'output_folder': './ch_ppocr_mobile_v2.0_cls_infer'}
W init: rknn-toolkit2 version: 1.5.1b19+4c81851a
W load_onnx: It is recommended onnx opset 12, but your onnx model opset is 9!
E load_onnx: Catch exception when loading onnx model: /home/ocr/ch_ppocr_mobile_v2.0_cls_infer/ch_ppocr_mobile_v2.0_cls_infer.onnx!
E load_onnx: Traceback (most recent call last):
E load_onnx: File "rknn/api/rknn_base.py", line 1527, in rknn.api.rknn_base.RKNNBase.load_onnx
E load_onnx: File "rknn/api/rknn_base.py", line 680, in rknn.api.rknn_base.RKNNBase._create_ir_and_inputs_meta
E load_onnx: File "rknn/api/ir_graph.py", line 66, in rknn.api.ir_graph.IRGraph.init
E load_onnx: File "rknn/api/ir_graph.py", line 521, in rknn.api.ir_graph.IRGraph.rebuild
E load_onnx: File "/root/anaconda3/envs/rknn2/lib/python3.6/site-packages/onnx/checker.py", line 106, in check_model
E load_onnx: C.check_model(protobuf_string)
E load_onnx: onnx.onnx_cpp2py_export.checker.ValidationError: Field 'shape' of type is required but missing.
W If you can't handle this error, please try updating to the latest version of the toolkit2 and runtime from:
https://eyun.baidu.com/s/3eTDMk6Y (Pwd: rknn) Path: RK_NPU_SDK / RK_NPU_SDK_1.X.0 / develop /
If the error still exists in the latest version, please collect the corresponding error logs and the model,
convert script, and input data that can reproduce the problem, and then submit an issue on:
https://redmine.rock-chips.com (Please consult our sales or FAE for the redmine account)
Traceback (most recent call last):
File "rockchip/rknpu2_tools/export.py", line 52, in
assert ret == 0, "Load model failed!"
AssertionError: Load model failed!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.