PaddlePaddle / FastDeploy

⚡️An Easy-to-use and Fast Deep Learning Model Deployment Toolkit for ☁️Cloud 📱Mobile and 📹Edge. Including Image, Video, Text and Audio 20+ main stream scenarios and 150+ SOTA models with end-to-end optimization, multi-platform and multi-framework support.
https://www.paddlepaddle.org.cn/fastdeploy
Apache License 2.0
2.82k stars 441 forks source link

RuntimeError: Can't set input blob with name: x, because model input (shape={?,3,32,?}) and blob (shape=(6.3.48.320)) are incompatible #1926

Open JackonLiu opened 1 year ago

JackonLiu commented 1 year ago

温馨提示:根据社区不完全统计,按照模板提问,可以加快回复和解决问题的速度


环境

问题日志及出现问题的操作流程

执行:examples\vision\ocr\PP-OCR\cpu-gpu\python\infer.py python infer.py --det_model ch_ppocr_server_v2.0_det_infer --rec_model ch_ppocr_server_v2.0_rec_infer --rec_label_file ppocr_keys_v1.txt --image 23.png --device cpu --backend openvino

` (pytorch-gpu) E:\program\FastDeploy-develop\FastDeploy-develop\examples\vision\ocr\PP-OCR\cpu-gpu\python>python infer.py --det_model ch_ppocr_server_v2.0_det_infer --rec_model ch_ppocr_server_v2.0_rec_infer --rec_label_file ppocr_keys_v1.txt --image 23.png --device cpu --backe nd openvino C:\Users\Administrator\anaconda3\envs\pytorch-gpu\lib\site-packages\numpy_distributor_init.py:30: UserWarning: loaded more than 1 DLL from .libs: C:\Users\Administrator\anaconda3\envs\pytorch-gpu\lib\site-packages\numpy.libs\libopenblas.FB5AE2TYXYH2IJRDKGDGQ3XBKLKTF43H.gfortran-win_amd64.dll C:\Users\Administrator\anaconda3\envs\pytorch-gpu\lib\site-packages\numpy.libs\libopenblas.QVLO2T66WEPI7JZ63PS3HMOHFEY472BC.gfortran-win_amd64.dll warnings.warn("loaded more than 1 DLL from .libs:" [FastDeploy][INFO]: Successfully found CUDA ToolKit from system PATH env -> C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1\bin [INFO] fastdeploy/runtime/backends/openvino/ov_backend.cc(218)::fastdeploy::OpenVINOBackend::InitFromPaddle number of streams:1. [INFO] fastdeploy/runtime/backends/openvino/ov_backend.cc(228)::fastdeploy::OpenVINOBackend::InitFromPaddle affinity:YES. [INFO] fastdeploy/runtime/backends/openvino/ov_backend.cc(240)::fastdeploy::OpenVINOBackend::InitFromPaddle Compile OpenVINO model on device_name:CPU. [INFO] fastdeploy/runtime/runtime.cc(279)::fastdeploy::Runtime::CreateOpenVINOBackend Runtime initialized with Backend::OPENVINO in Device::CPU. [INFO] fastdeploy/runtime/backends/openvino/ov_backend.cc(218)::fastdeploy::OpenVINOBackend::InitFromPaddle number of streams:1. [INFO] fastdeploy/runtime/backends/openvino/ov_backend.cc(228)::fastdeploy::OpenVINOBackend::InitFromPaddle affinity:YES. [INFO] fastdeploy/runtime/backends/openvino/ov_backend.cc(240)::fastdeploy::OpenVINOBackend::InitFromPaddle Compile OpenVINO model on device_name:CPU. [INFO] fastdeploy/runtime/runtime.cc(279)::fastdeploy::Runtime::CreateOpenVINOBackend Runtime initialized with Backend::OPENVINO in Device::CPU. Traceback (most recent call last): File "infer.py", line 132, in result = ppocrv3.predict(im) File "C:\Users\Administrator\anaconda3\envs\pytorch-gpu\lib\site-packages\fastdeploy\vision\ocr\ppocr__init__.py", line 702, in predict return self.system.predict(input_image) RuntimeError: Can't set input blob with name: x, because model input (shape={?,3,32,?}) and blob (shape=(6.3.48.320)) are incompatible

`

DefTruth commented 1 year ago

可以尝试最新的1.0.6版本

JackonLiu commented 1 year ago

可以尝试最新的1.0.6版本

我刚试了,还是一样的问题

ChaoII commented 1 year ago

可以尝试最新的1.0.6版本

我刚试了,还是一样的问题

是不是模型不对,你用example中提供的模型试试

JackonLiu commented 1 year ago

你对了,用example中提供的模型才行,用其他模型就不行,有解决办法吗?

ChaoII commented 1 year ago

你对了,用example中提供的模型才行,用其他模型就不行,有解决办法吗?

你用的模型前处理后的输入可能和ppocrv3模型对不上,要么自己比较熟悉怎么改要么就直接换模型。个人建议直接换模型,新的ocr模型从精度和速度上都是有明显优势的。

JackonLiu commented 1 year ago

我用的ch_ppocr_server_v2.0_rec_infer那个模型,速度较ch_PP-OCRv3_rec_infer差一点,但精度好一点