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.92k stars 456 forks source link

PPOCRV2 的 example执行报错 #1755

Closed ANDROIDTODO closed 1 year ago

ANDROIDTODO commented 1 year ago

Hi FastDeploy Teams,

我的环境是Mac M1 12.3 我根据教程编译了fastdepoly,编译命令:

cmake .. -DENABLE_ORT_BACKEND=ON \
         -DENABLE_PADDLE_BACKEND=OFF \
         -DENABLE_OPENVINO_BACKEND=OFF \
         -DCMAKE_INSTALL_PREFIX=${PWD}/compiled_fastdeploy_sdk \
         -DENABLE_VISION=ON \
         -DENABLE_TEXT=OFF
make -j8
make install

在compiled_fastdeploy_sdk/examples/vision/ocr/PP-OCRv2/cpp下, 编译了PP-OCRv2的demo后,执行

./infer_demo ./ch_PP-OCRv2_det_infer ./ch_ppocr_mobile_v2.0_cls_infer ./ch_ppocr_server_v2.0_rec_infer ./ch_en.txt ./all_font_color.jpg 0

报错:

[WARNING] fastdeploy/runtime/runtime_option.cc(376)::SetTrtInputShape   `RuntimeOption::SetTrtInputShape` will be removed in v1.2.0, please use `RuntimeOption.trt_option.SetShape()` instead.
[WARNING] fastdeploy/runtime/runtime_option.cc(376)::SetTrtInputShape   `RuntimeOption::SetTrtInputShape` will be removed in v1.2.0, please use `RuntimeOption.trt_option.SetShape()` instead.
[WARNING] fastdeploy/runtime/runtime_option.cc(376)::SetTrtInputShape   `RuntimeOption::SetTrtInputShape` will be removed in v1.2.0, please use `RuntimeOption.trt_option.SetShape()` instead.
[INFO] fastdeploy/runtime/runtime.cc(293)::CreateOrtBackend Runtime initialized with Backend::ORT in Device::CPU.
[INFO] fastdeploy/runtime/runtime.cc(293)::CreateOrtBackend Runtime initialized with Backend::ORT in Device::CPU.
[INFO] fastdeploy/runtime/runtime.cc(293)::CreateOrtBackend Runtime initialized with Backend::ORT in Device::CPU.
[ERROR] fastdeploy/runtime/backends/ort/ort_backend.cc(365)::Infer  Failed to Infer: Got invalid dimensions for input: x for the following indices
 index: 2 Got: 800 Expected: 960
 index: 3 Got: 672 Expected: 960
 Please fix either the inputs or the model.
[ERROR] fastdeploy/vision/ocr/ppocr/dbdetector.cc(107)::BatchPredict    Failed to inference by runtime.
[ERROR] fastdeploy/vision/ocr/ppocr/ppocr_v2.cc(115)::BatchPredict  There's error while detecting image in PPOCR.
Failed to predict.

我想问是哪里出错了吗?

yunyaoXYY commented 1 year ago

模型是哪里下载的,这个模型看着是一个固定shape的模型, 然而输入是动态的

ANDROIDTODO commented 1 year ago

模型是从PaddleOCR那下载的,现在换成FastDepoly中验证过的就可以了。谢谢