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

RuntimeError: could not execute a primitive 错误问题 #7990

Closed
ybshaw opened this issue Oct 19, 2022 · 4 comments
Closed

RuntimeError: could not execute a primitive 错误问题 #7990

ybshaw opened this issue Oct 19, 2022 · 4 comments
Assignees

Comments

@ybshaw
Copy link

ybshaw commented Oct 19, 2022

使用Flask包装成http接口,开启服务之后,测试图片时出现下面错误(每次从第二张图片开始就报错导,第一张是正常)

  • 我的代码
model = PaddleOCR(......)
file_path = '/home/ocr/test.jpg'
ocr_output,  ocr_time = get_ocr_output(img_path=file_path, model=model)
  • 报错问题:
Traceback (most recent call last):
  File "server.py", line 100, in server
    ocr_output,  ocr_time = get_ocr_output(img_path=file_path, model=model)
  File "/root/hangyan/route-rec/ocr.py", line 24, in get_ocr_output
    output = model.ocr(img_path, cls=True)
  File "/root/py-venvs/flaks-venv/lib64/python3.6/site-packages/paddleocr/paddleocr.py", line 474, in ocr
    dt_boxes, rec_res = self.__call__(img, cls)
  File "/root/py-venvs/flaks-venv/lib64/python3.6/site-packages/paddleocr/tools/infer/predict_system.py", line 85, in __call__
    img_crop_list)
  File "/root/py-venvs/flaks-venv/lib64/python3.6/site-packages/paddleocr/tools/infer/predict_cls.py", line 111, in __call__
    self.predictor.run()
RuntimeError: could not execute a primitive

关闭mkldnn时,就没有这种错误,看了相关的issue,发现有人提出说是版本问题,但是我升级了版本,还是一样的问题;推测是mkldnn的问题,想问下是因为开启mkldnn之后内存占用过大的原因吗,但是看报错信息又是在predict_cls.py文件中,有没有相关解决办法呢

  • 环境
centos 7 CPU 2核, 内存2G
paddlepaddle==2.3.1
paddleocr==2.5.0.3

@ybshaw
Copy link
Author

ybshaw commented Oct 19, 2022

经过测试,本地windows环境下不会出现这种问题
windows配置信息

处理器:Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz   3.60 GHz
内存:16G

同样代码,在4核CPU 8G内存的 Intel Xeon CPU E5-2678的服务器上也是一样的错误信息

@pengfeidip
Copy link

我的也是 , 服务器上报错

@uniqlo1
Copy link

uniqlo1 commented Jun 27, 2024

请问现在这个问题有解决吗,在不关闭mkldnn加速的情况下

@GreatV
Copy link
Collaborator

GreatV commented Jun 27, 2024

@uniqlo1 换成dev 版本的paddle再试试看

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

No branches or pull requests

5 participants