Git Product home page Git Product logo

Comments (5)

swdee avatar swdee commented on June 9, 2024 1

The real problem is the documentation being out of date. The --input_shape_dict is a deprecated argument. The instructions here show how to do this with current versions of paddle and paddle2onnx.

To summarise the following steps worked for me for converting the Japanese text model.

Install Paddle2ONNX.

pip3 install paddlepaddle
pip3 install paddle2onnx

Convert to ONNX.

paddle2onnx --model_dir ./japan_PP-OCRv3_rec_infer/ \
--model_filename inference.pdmodel \
--params_filename inference.pdiparams \
--save_file ./japanv3-rec.onnx

Change the Input shape parameters.

python3 -m paddle2onnx.optimize --input_model japanv3-rec.onnx \
--output_model japanv3-rec.onnx --input_shape_dict "{'x':[1,3,48,320]}"

from paddleocr.

Sunting78 avatar Sunting78 commented on June 9, 2024

The quantitative export will quantize or prune the model parameters, making the model smaller. What is the specific error in question 4 ?

from paddleocr.

hacktmz avatar hacktmz commented on June 9, 2024

我也是 编译之后还是存在找不到参数paddle2onnx: error: unrecognized arguments: --input_shape_dict={'x':[-1,3,-1,-1]}

from paddleocr.

swdee avatar swdee commented on June 9, 2024

I get same error about unrecognized arguments on --input_shape_dict by following the docs here

$ paddle2onnx --version
2024-05-15 17:17:51 [INFO]      paddle2onnx-1.2.1 with python>=3.6, paddlepaddle>=2.0.0

$ paddle2onnx --model_dir ./japan_PP-OCRv3_rec_infer/ --model_filename inference.pdmodel --params_filename inference.pdiparams --save_file ./japanv3-rec.onnx --opset_version 11 --input_shape_dict="{'x':[-1,3,-1,-1]}" --enable_onnx_checker True 

usage: paddle2onnx [-h] [--model_dir MODEL_DIR] [--model_filename MODEL_FILENAME] [--params_filename PARAMS_FILENAME] [--save_file SAVE_FILE] [--opset_version OPSET_VERSION]
                   [--deploy_backend {onnxruntime,tensorrt,rknn,others}] [--save_calibration_file SAVE_CALIBRATION_FILE] [--enable_onnx_checker ENABLE_ONNX_CHECKER] [--enable_paddle_fallback ENABLE_PADDLE_FALLBACK]
                   [--version] [--enable_auto_update_opset ENABLE_AUTO_UPDATE_OPSET] [--external_filename EXTERNAL_FILENAME] [--export_fp16_model EXPORT_FP16_MODEL] [--custom_ops CUSTOM_OPS]

paddle2onnx: error: unrecognized arguments: --input_shape_dict={'x':[-1,3,-1,-1]}

from paddleocr.

Sunting78 avatar Sunting78 commented on June 9, 2024

您好,问题超过一周未回复将关闭。如有问题可重开issue.

from paddleocr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.