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
用导出的微调量化模型(车牌检测和识别都一样)对测试集进行预测出现报错input_data_type:5 != filter_data_type:21. #12073
Comments
CCPD车牌检测数据集fine-tune+量化训练: 检测量化模型导出: CCPD车牌识别数据集fine-tune+量化训练: 识别量化模型导出: 用导出的量化模型对测试集进行预测: |
看起来是ValueError: (InvalidArgument) input and filter data type should be consistent, but received input data type is float and filter type is int8_t 显示的转下数据类型看看 |
请问:deploy/slim/quantization/README.md 里面说:“备注:量化训练后的模型参数是float32类型,转inference model预测时相对不量化无加速效果,原因是量化后模型结构之间存在量化和反量化算子,如果要使用量化模型部署,建议使用TensorRT并设置precision为INT8加速量化模型的预测时间。”那我应该在命令后面加入参数--use_tensorrt=USE_TENSORRT --precision=INT8,我加入后依然一样的报错。 |
请问您是怎么处理双行车牌的识别的呢? |
我的是单行的识别 |
显示的转下数据类型尝试一下 把输入的图像转int8 |
使用cpu版本,解决全部问题!! |
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
系统环境/System Environment:3.10.4
版本号/Version:Paddle:2.6.1 PaddleOCR: 问题相关组件/Related components:tools/infer/predict_system.py
运行指令/Command Code:python tools/infer/predict_system.py --det_model_dir=output/CCPD/det_quant/infer --rec_model_dir=output/CCPD/rec_quant/infer --det_limit_side_len=736 --det_limit_type=min --image_dir=F:/DataSet/CCPD2020/ccpd_green/test/ --draw_img_save_dir=infer/quant --use_dilation=true
完整报错/Complete Error Message:
(base) (venv) PS F:\GithubProject\PaddleOCR> python tools/infer/predict_system.py --det_model_dir=output/CCPD/det_quant/infer --rec_model_dir=output/CCPD/rec_quant/infer --det_limit_side_len=736 --det_limit_type=min --image_dir=F:/DataSet/CCPD2020/ccpd_green/test/ --draw_img_save_dir=infer/quant --use_dilation=true
[2024/05/08 10:27:31] ppocr INFO: In PP-OCRv3, rec_image_shape parameter defaults to '3, 48, 320', if you are using recognition model with PP-OCRv2 or an older version, please set --rec_image_shape='3,32,320
Traceback (most recent call last):
File "F:\GithubProject\PaddleOCR\tools\infer\predict_system.py", line 295, in
main(args)
File "F:\GithubProject\PaddleOCR\tools\infer\predict_system.py", line 196, in main
dt_boxes, rec_res, time_dict = text_sys(img)
File "F:\GithubProject\PaddleOCR\tools\infer\predict_system.py", line 83, in call
dt_boxes, elapse = self.text_detector(img)
File "F:\GithubProject\PaddleOCR\tools\infer\predict_det.py", line 379, in call
dt_boxes, elapse = self.predict(img)
File "F:\GithubProject\PaddleOCR\tools\infer\predict_det.py", line 240, in predict
self.predictor.run()
ValueError: (InvalidArgument) input and filter data type should be consistent, but received input data type is float and filter type is int8_t
[Hint: Expected input_data_type == filter_data_type, but received input_data_type:5 != filter_data_type:21.] (at ..\paddle\fluid\operators\generator\get_expected_kernel_func.cc:431)
[operator < conv2d > error]
The text was updated successfully, but these errors were encountered: