Paddleocr3.0.0版本运行报错
🔎 Search before asking
- [x] I have searched the PaddleOCR Docs and found no similar bug report.
- [x] I have searched the PaddleOCR Issues and found no similar bug report.
- [x] I have searched the PaddleOCR Discussions and found no similar bug report.
🐛 Bug (问题描述)
我运行报错-------------------------------------- C++ Traceback (most recent call last):
0 phi::OneDNNContextThreadLocals::Body::~Body() 1 phi::OneDNNContext::Impl::ResetBlobMap(void*)
Error Message Summary:
FatalError: Process abort signal is detected by the operating system.
[TimeInfo: *** Aborted at 1748315176 (unix time) try "date -d @1748315176" if you are using GNU date ***]
[SignalInfo: *** SIGABRT (@0x3e90023bacb) received by PID 2341579 (TID 0x7f42dd89a280) from PID 2341579 ***]
🏃♂️ Environment (运行环境)
cuda11.8 python3.10 paddlepaddle-gpu==3.0.0 paddleocr=3.0.0
🌰 Minimal Reproducible Example (最小可复现问题的Demo)
from paddleocr import PaddleOCR import paddle import time import os import logging
设置日志记录器
logger = logging.getLogger() logger.setLevel(logging.INFO)
清空现有的处理器以避免重复
logger.handlers.clear()
添加新的处理器
ch = logging.StreamHandler() formatter = logging.Formatter("%(asctime)s - %(module)s - %(funcName)s - line:%(lineno)d - %(levelname)s - %(message)s") ch.setFormatter(formatter) logger.addHandler(ch)
pwd_path = os.path.abspath(os.path.dirname(file)) logger.info(f"PaddeleOCR is runing on path: {pwd_path}")
os.environ["CUDA_VISIBLE_DEVICES"] = "3"
use_cuda = paddle.is_compiled_with_cuda() # 检查paddle是否编译了 CUDA 支持 logger.info(f'use_cuda:{use_cuda}') if use_cuda: cuda_name = paddle.device.cuda.get_device_name() # 获取当前使用的 GPU 型号 logger.info(f'cuda_name:{cuda_name}')
t1 = time.time()
ocr = PaddleOCR(ocr_version="PP-OCRv5", use_doc_orientation_classify=False, # 文档方向分类模型 默认true 检测整个文档图像的方向并纠正(即0度,90度,180度,270度)。 use_doc_unwarping=False, # 文本图像矫正模型 默认true 纠正图像中的透视变形或弯曲,使文档看起来像是正面拍摄的平面图像。 use_textline_orientation=False, # 文本行方向分类模型 默认true 识别文本行是水平排列还是垂直排列。 device="gpu" )
result = ocr.predict(01.png") t2 = time.time() print(f"ocr time {t2 - t1}")
for res in result: res.print() res.save_to_img("output") res.save_to_json("output")
这个报错应该暂时不影响输出正确的结果,目前看应该是飞桨框架的某种兼容性问题,我们还在排查
以前的版本有个选项 use_gpu=False 现在怎么没了
这个报错应该暂时不影响输出正确的结果,目前看应该是飞桨框架的某种兼容性问题,我们还在排查
@cuicheng01 我下午就在轮着测降版能不能跑通,结果就把 ocr 降到 2.10.0 就跑通了,那是不是问题不在框架?
https://github.com/PaddlePaddle/PaddleOCR/issues/15558
以前的版本有个选项 use_gpu=False 现在怎么没了
device="gpu" 这里改成cpu即可
The issue has no response for a long time and will be closed. You can reopen or new another issue if are still confused.
From Bot