PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
42k stars 7.62k forks source link

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:423) [operator < conv2d > error] #13340

Closed aa851182472 closed 1 month ago

aa851182472 commented 1 month ago

问题描述 / Problem Description

PaddleOCR中用导出的模型对测试集进行预测

运行环境 / Runtime Environment

运行命令python3 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=/mnt/workspace/PaddleOCR/CCPD2020/ccpd_green/val/ --draw_img_save_dir=infer/quant --use_dilation=true

复现代码 / Reproduction Code

完整报错 / Complete Error Message

Traceback (most recent call last): File "tools/infer/predict_system.py", line 326, in main(args) File "tools/infer/predict_system.py", line 227, in main dt_boxes, rec_res, time_dict = text_sys(img) File "tools/infer/predict_system.py", line 109, in call dt_boxes, elapse = self.text_detector(img) File "/mnt/workspace/PaddleOCR/tools/infer/predict_det.py", line 394, in call dt_boxes, elapse = self.predict(img) File "/mnt/workspace/PaddleOCR/tools/infer/predict_det.py", line 255, 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:423) [operator < conv2d > error]

可能解决方案 / Possible solutions

附件 / Appendix

GreatV commented 1 month ago

试试没量化的模型