FastDeploy
FastDeploy copied to clipboard
ocr多语言检测openvino和onnx两个引擎在cpu上报错
温馨提示:根据社区不完全统计,按照模板提问,可以加快回复和解决问题的速度
环境
- 【FastDeploy版本】: 1.0.7
- 【编译命令】官方docker
- 【系统平台】: Linux x64(Ubuntu 18.04)
- 【硬件】: Nvidia GPU 3070, CUDA 12.2 CUDNN 8.3
- 【编译语言】: python3.8
问题日志及出现问题的操作流程
- 【模型跑不通】
ocr多语言检测openvino和onnx两个引擎在cpu上报错
模型文件:
https://paddleocr.bj.bcebos.com/PP-OCRv3/multilingual/Multilingual_PP-OCRv3_det_infer.tar
使用测试代码
https://github.com/PaddlePaddle/FastDeploy/blob/develop/examples/vision/ocr/PP-OCR/cpu-gpu/python/infer.py
调用参数:
--det_model Multilingual_PP-OCRv3_det_infer --cls_model ch_ppocr_mobile_v2.0_cls_infer --rec_model ch_PP-OCRv3_rec_infer --rec_label_file ppocr_keys_v1.txt --image 12.jpg --device cpu --backend openvino
报错:
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/root/.vscode-server/extensions/ms-python.python-2023.16.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/main.py", line 39, in
cli.main() File "/root/.vscode-server/extensions/ms-python.python-2023.16.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main run() File "/root/.vscode-server/extensions/ms-python.python-2023.16.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file runpy.run_path(target, run_name="main") File "/root/.vscode-server/extensions/ms-python.python-2023.16.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path return _run_module_code(code, init_globals, run_name, File "/root/.vscode-server/extensions/ms-python.python-2023.16.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code _run_code(code, mod_globals, init_globals, File "/root/.vscode-server/extensions/ms-python.python-2023.16.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in run_code exec(code, run_globals) File "/FastDeploy/examples/vision/ocr/PP-OCR/cpu-gpu/python/infer.py", line 211, in result = ppocr_v3.predict(im) File "/usr/local/lib/python3.8/dist-packages/fastdeploy/vision/ocr/ppocr/init.py", line 966, in predict return self.system .predict(input_image) RuntimeError: Can't set input blob with name: x, because model input (shape=[?,3,960,960]) and blob (shape=(1.3.960.672)) are incompatible
看报错是输入的shape不匹配导致的,可能是预处理啥的有问题