Skip to content

量化训练 #15045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
yikoudamifan opened this issue Apr 18, 2025 · 5 comments
Open
3 tasks done

量化训练 #15045

yikoudamifan opened this issue Apr 18, 2025 · 5 comments
Assignees

Comments

@yikoudamifan
Copy link

🔎 Search before asking

  • I have searched the PaddleOCR Docs and found no similar bug report.
  • I have searched the PaddleOCR Issues and found no similar bug report.
  • I have searched the PaddleOCR Discussions and found no similar bug report.

🐛 Bug (问题描述)

在进行量化训练时,ppocrv3进行检测量化训练和识别量化模型时都出现的参数不匹配的现象,PaddleOCR为2.8.0版本
python3 deploy/slim/quantization/quant.py -c configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_student.yml

Image

Image

🏃‍♂️ Environment (运行环境)

paddleocr:2.8.1
paddlepaddle-gpu:2.6.1

🌰 Minimal Reproducible Example (最小可复现问题的Demo)

python3 deploy/slim/quantization/quant.py -c configs/det/ch_PP-OCRv3/ch_PP-OCRv3_det_student.yml

@jingsongliujing
Copy link
Collaborator

这个只是警告,有无完整报错日志?

@yikoudamifan
Copy link
Author

这个只是警告,有无完整报错日志?

并未出现报错,只是有警告,想确定警告是否影响精度。

@yikoudamifan
Copy link
Author

可以正常训练,paddle推理模型也可以正常推理,使用以下命令转为onnx模型后,模型无法检测和识别任何东西。
paddle2onnx --model_dir /data/GamingAI/model/output/det/06_ch_PP-OCR_V3_det_2505_slim/best_model/infer86 --model_filename inference.pdmodel --params_filename inference.pdiparams --save_file /data/GamingAI/model/output/det/06_ch_PP-OCR_V3_det_2505_slim/best_model/infer86/quant_model.onnx --opset_version 14 --deploy_backend onnxruntime --enable_onnx_checker True

导出模型时出现了算子警告,但是可以成功导出:

Image

模型推理效果如下:

Image

@jingsongliujing
Copy link
Collaborator

Paddle2ONNX 本身不依赖其他组件,但是我们建议您在以下环境下使用 Paddle2ONNX :

PaddlePaddle == 2.6.0
onnxruntime >= 1.10.0

@yikoudamifan
Copy link
Author

Paddle2ONNX 本身不依赖其他组件,但是我们建议您在以下环境下使用 Paddle2ONNX :

PaddlePaddle == 2.6.0 onnxruntime >= 1.10.0

按照您说的,我修改了对应的版本,算子警告没有了但是依然推理不出结果

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants