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

含文字图像方向识别,报错:basic_string::at: __n (which is 0) >= this->size() (which is 0) #3305

Open
sxk000 opened this issue Nov 18, 2024 · 2 comments
Assignees

Comments

@sxk000
Copy link

sxk000 commented Nov 18, 2024

首先,感谢模型、框架、代码的分享!

最近在使用PaddleClas 做含文字图像方向识别时,报错:basic_string::at: __n (which is 0) >= this->size() (which is 0)

操作系统,centos7
PaddleClas 2.6.0
paddlepaddle 2.6.2
python 3.11
cpu环境

按照:https://github.com/PaddlePaddle/PaddleClas/blob/release/2.5/docs/zh_CN/models/PULC/PULC_text_image_orientation.md

上介绍的运行命令:
paddleclas --model_name=text_image_orientation --infer_imgs=pulc_demo_imgs/text_image_orientation/img_rot0_demo.jpg

报如下错误:

[2024/11/18 17:12:04] ppcls WARNING: The current running environment does not support the use of GPU. CPU has been used instead.
---1 <paddle.base.libpaddle.AnalysisConfig object at 0x7fbec19ea030>
Traceback (most recent call last):
  File "/apply/miniconda3/envs/p311invoice/bin/paddleclas", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/apply/miniconda3/envs/p311invoice/lib/python3.11/site-packages/paddleclas/paddleclas.py", line 818, in main
    clas_engine = PaddleClas(**cfg)
                  ^^^^^^^^^^^^^^^^^
  File "/apply/miniconda3/envs/p311invoice/lib/python3.11/site-packages/paddleclas/paddleclas.py", line 610, in __init__
    self.predictor = ClsPredictor(self._config)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/apply/miniconda3/envs/p311invoice/lib/python3.11/site-packages/paddleclas/deploy/python/predict_cls.py", line 28, in __init__
    super().__init__(config["Global"])
  File "/apply/miniconda3/envs/p311invoice/lib/python3.11/site-packages/paddleclas/deploy/utils/predictor.py", line 37, in __init__
    self.predictor, self.config = self.create_paddle_predictor(
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/apply/miniconda3/envs/p311invoice/lib/python3.11/site-packages/paddleclas/deploy/utils/predictor.py", line 109, in create_paddle_predictor
    predictor = create_predictor(config)
                ^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: basic_string::at: __n (which is 0) >= this->size() (which is 0)

请问改怎么解决呢?谢谢!

@liuhongen1234567
Copy link
Collaborator

您好,这个问题不是很好解决,我们正在排查中

@TingquanGao
Copy link
Collaborator

TingquanGao commented Dec 12, 2024

我在Linux环境python 3.10环境下,使用相同的paddle版本 paddleclas版本,未能复现该问题。可以使用以下代码初步检查一下paddle是否安装成功:

import paddle
paddle.utils.install_check.run_check()

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

3 participants