Skip to content
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

使用paddlejsconverter转换paddleorc的中文文字识别模型后,模型不能正常加载。 #501

Open
jprorikon opened this issue May 23, 2023 · 4 comments

Comments

@jprorikon
Copy link

模型使用
https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.6/doc/doc_en/models_list_en.md#21-chinese-recognition-model
的ch_PP-OCRv3_det的inference model

paddlejsconverter版本1.0.8
转换模型使用以下命令
python 'Paddle.js-release-v2.2.5/packages/paddlejs-converter/convertToPaddleJSModel.py' --modelPath=inference.pdmodel --paramPath=inference.pdiparams --outputDir=../ --useGPUOpt=True --disableOptimize=1

使用的web demo为
https://github.com/PaddlePaddle/FastDeploy/tree/develop/examples/application/js/web_demo中的TextDetection

将模型放置到本地,用inport“?url”的方式传递url给orc.loader

模型不能正常被加载,浏览器控制台报
index.js:1 webgl createProgram: conv2d_depthwise -- Error: Error: compile: ERROR: 0:188: 'undefined' : undeclared identifier ERROR: 0:188: '' : boolean expression expected
错误。

@jprorikon
Copy link
Author

@JingyuanZhang 能帮忙解决一下么?

@im-ajaymeena
Copy link

I am also having similar issues when running OCR demo with converted model:

image

for converting I used:
python convertToPaddleJSModel.py --modelPath=../../../inference.pdmodel --paramPath=../../../inference.pdiparams --outputDir=. --disableOptimize=1 --useGPUOpt=1

I used japan_PP-OCRv3_rec model

@allenliuvip
Copy link

+1 基本上没有模型能成功

@VuHuy-cse-9
Copy link

VuHuy-cse-9 commented Mar 30, 2024

I received errors from paddles like this, conv2d_tranpose and conv2d had a similar notification:
webgl createProgram: conv2d_depthwise -- Error: Error: compile: ERROR: 0:188: 'undefined' : undeclared identifier ERROR: 0:188: '' : boolean expression expected
I was working around pp-OCRv3-det. I realized something:

  • Conv2d-depthwise and Conv2d Tranpose are not supported by paddlejs (I used @paddle-js-models/ocrdet==4.1.1). Conv2d Depthwise is used in MobileNetv3, and Conv2d Tranpose is used in DBHead. You may (somehow) change these operations to make it work.
  • Problem of conv2d can be solved by changing paddlepaddle-gpu from 2.6.0.post112 to 2.3.2.post112.
    I hope suggestions may be helpful.

For paddlejs-converter, I use:
paddlepaddle==2.5.1
paddlejsconverter==1.0.7
paddlelite==2.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants