You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
请提供下述完整信息以便快速定位问题
(Please provide the following information to quickly locate the problem)
系统环境/System Environment:macOS
使用的是哪门语言的程序/Which programing language:Python
所使用语言相关版本信息/Version:3.8
OnnxRuntime版本/OnnxRuntime Version:1.15.1
可复现问题的demo/Demo of reproducible problems:
在读取 img.ndim = 2 的图像时,发生如下报错信息:
Traceback (most recent call last):
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py", line 1496, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/liuqian/Downloads/Langchain-Chatchat/pdf.py", line 6, in <module>
docs = loader.load()
File "/opt/homebrew/Caskroom/miniforge/base/envs/chatchat/lib/python3.8/site-packages/langchain/document_loaders/unstructured.py", line 86, in load
elements = self._get_elements()
File "/Users/liuqian/Downloads/Langchain-Chatchat/document_loaders/mypdfloader.py", line 29, in _get_elements
text = pdf2text(self.file_path)
File "/Users/liuqian/Downloads/Langchain-Chatchat/document_loaders/mypdfloader.py", line 23, in pdf2text
result, _ = ocr(img_array)
File "/opt/homebrew/Caskroom/miniforge/base/envs/chatchat/lib/python3.8/site-packages/rapidocr_onnxruntime/rapid_ocr_api.py", line 74, in __call__
dt_boxes, det_elapse = self.text_detector(img)
File "/opt/homebrew/Caskroom/miniforge/base/envs/chatchat/lib/python3.8/site-packages/rapidocr_onnxruntime/ch_ppocr_v3_det/text_detect.py", line 65, in __call__
data = transform(data, self.preprocess_op)
File "/opt/homebrew/Caskroom/miniforge/base/envs/chatchat/lib/python3.8/site-packages/rapidocr_onnxruntime/ch_ppocr_v3_det/utils.py", line 225, in transform
data = op(data)
File "/opt/homebrew/Caskroom/miniforge/base/envs/chatchat/lib/python3.8/site-packages/rapidocr_onnxruntime/ch_ppocr_v3_det/utils.py", line 79, in __call__
data["image"] = (img * self.scale - self.mean) / self.std
ValueError: operands could not be broadcast together with shapes (1568,1120) (1,1,3)
请提供下述完整信息以便快速定位问题
(Please provide the following information to quickly locate the problem)
在读取 img.ndim = 2 的图像时,发生如下报错信息:
经与 img.ndim=3 的图像处理时的对比发现,发生此报错的原因是
img * self.scale
为 15681120 维矩阵,self.mean
为 11*3 维矩阵无法执行计算导致。The text was updated successfully, but these errors were encountered: