PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
Apache License 2.0
41.15k stars 7.54k forks source link

paddler 疑似与其他模型冲突 #11528

Open RichardQin1 opened 6 months ago

RichardQin1 commented 6 months ago

目标场景是使用paddle识别ocr结果 在另外的流程中使用modelscope的模型进行nlp分析。但似乎只要添加了from modelscope import pipeline, Tasks就报错。 注释掉就没问题。是否包冲突、有无解决优化和解决方案

ocr = PaddleOCR(use_angle_cls=True, lang="ch")

def get_ocr_content(ocr, video_path, start_time, end_time, name_list): video = cv2.VideoCapture(video_path) frame_count = int(video.get(cv2.CAP_PROP_FRAME_COUNT)) # 获取视频的总帧数 fps = video.get(cv2.CAP_PROP_FPS) start_frame = int(start_time fps) end_frame = int(end_time fps) interval = 25 # 每25帧抽一帧 for i in range(start_frame, end_frame, interval): video.set(cv2.CAP_PROP_POS_FRAMES, i) # 设置到特定帧 ret, frame = video.read() if not ret: # 如果读取失败,跳过该帧 continue result = ocr.ocr(frame, cls=True) # 对当前帧进行OCR识别 text = " " for idx in range(len(result)): res = result[idx] if res is None: continue for line in res: for name in name_list: print(nlp.to_simplified_chinese(line[1][0])) if name in nlp.to_simplified_chinese(line[1][0]): return name return None

get_ocr_content(ocr, video_path, start, end, name_list)

- 完整报错/Complete Error Message:

Traceback (most recent call last): File "/home/phoenix/python_project/funasr_test/ocr.py", line 33, in name = get_ocr_content(ocr, video_path, start, end, name_list) File "/home/phoenix/python_project/funasr_test/videoOCR.py", line 23, in get_ocr_content result = ocr.ocr(frame, cls=True) # 对当前帧进行OCR识别 File "/home/phoenix/anaconda3/envs/funasr/lib/python3.8/site-packages/paddleocr/paddleocr.py", line 661, in ocr dt_boxes, recres, = self.call(img, cls) File "/home/phoenix/anaconda3/envs/funasr/lib/python3.8/site-packages/paddleocr/tools/infer/predict_system.py", line 99, in call img_crop_list, angle_list, elapse = self.text_classifier( File "/home/phoenix/anaconda3/envs/funasr/lib/python3.8/site-packages/paddleocr/tools/infer/predict_cls.py", line 111, in call self.predictor.run() OSError: (External) CUBLAS error(15). [Hint: 'CUBLAS_STATUS_NOT_SUPPORTED'. The functionality requested is not supported ] (at /paddle/paddle/phi/kernels/funcs/blas/blas_impl.cu.h:41) [operator < fc > error]


我们提供了AceIssueSolver来帮助你解答问题,你是否想要它来解答(请填写yes/no)?/We provide AceIssueSolver to solve issues, do you want it? (Please write yes/no):yes
gongel commented 2 months ago

+1

jingsongliujing commented 1 month ago

建议paddlepaddle-gpu版本安装老版本的:https://www.paddlepaddle.org.cn/install/old,这里推荐:python -m pip install paddlepaddle-gpu==2.3.2 -i https://pypi.tuna.tsinghua.edu.cn/simple ,新版本的问题比较多

GreatV commented 1 month ago

@jingsongliujing, 大佬,最好推荐用户使用最新版本的paddle。

1443244362 commented 1 week ago

确实 paddle-gpu和pytorch冲突 反正不能一起用 2.4.2版本现在自身就有问题也不能用了