CnOCR icon indicating copy to clipboard operation
CnOCR copied to clipboard

是已经不维护了么。

Open likohank opened this issue 10 months ago • 3 comments

新服务器pip3.9安装后启动各种报错,numpy的错误处理完之后,又一堆错误。。 好奇各位前辈都是怎么把它跑起来的。

likohank avatar Jun 29 '25 15:06 likohank

centos7.6 python 3.9 新系统,安装完成后,直接启动报错

root@VM-16-13-centos[23:44:10]:~/aaaaa# cat a.py from cnocr import CnOcr

img_fp = './1.jpg' ocr = CnOcr() # 所有参数都使用默认值 out = ocr.ocr(img_fp)

print(out)

root@VM-16-13-centos[23:44:12]:~/aaaaa#
root@VM-16-13-centos[23:44:13]:~/aaaaa#
root@VM-16-13-centos[23:44:13]:~/aaaaa#
root@VM-16-13-centos[23:44:14]:~/aaaaa# python3.9 a.py

[INFO] 2025-06-29 23:44:19,599 [RapidOCR] base.py:24: Using engine_name: onnxruntime [INFO] 2025-06-29 23:44:19,601 [RapidOCR] main.py:55: Using /root/.cnstd/1.2/ppocr/ch_PP-OCRv5_det/ch_PP-OCRv5_det_infer.onnx Traceback (most recent call last): File "/root/aaaaa/a.py", line 4, in ocr = CnOcr() # 所有参数都使用默认值 File "/usr/local/lib/python3.9/site-packages/cnocr/cn_ocr.py", line 170, in init self.det_model = CnStd( File "/usr/local/lib/python3.9/site-packages/cnstd/cn_std.py", line 99, in init self.det_model = det_cls( File "/usr/local/lib/python3.9/site-packages/cnstd/ppocr/rapid_detector.py", line 169, in init self._detector = TextDetector(config) File "/usr/local/lib/python3.9/site-packages/rapidocr/ch_ppocr_det/main.py", line 45, in init self.session = get_engine(cfg.engine_type)(cfg) File "/usr/local/lib/python3.9/site-packages/rapidocr/inference_engine/onnxruntime/main.py", line 62, in init self.session = InferenceSession( File "/usr/local/lib64/python3.9/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 419, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "/usr/local/lib64/python3.9/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 452, in _create_inference_session sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model) onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Load model from /root/.cnstd/1.2/ppocr/ch_PP-OCRv5_det/ch_PP-OCRv5_det_infer.onnx failed:/onnxruntime_src/onnxruntime/core/graph/model.cc:149 onnxruntime::Model::Model(onnx::ModelProto&&, const PathString&, const IOnnxRuntimeOpSchemaRegistryList*, const onnxruntime::logging::Logger&, const onnxruntime::ModelOptions&) Unsupported model IR version: 10, max supported IR version: 9

likohank avatar Jun 29 '25 15:06 likohank

前两天刚更新,怎么会没维护。。 这个报错是 onnxruntime 的版本问题吧,你升级下版本试试

breezedeus avatar Jun 30 '25 01:06 breezedeus

前两天刚更新,怎么会没维护。。 这个报错是 onnxruntime 的版本问题吧,你升级下版本试试

感谢。 因为尝试了 docker 拉取, 发现最新的docker 是17个月前的, docker在启动时依赖一些阿里云的文件,但是阿里云文件好像已经过期了,路径失效,所以docker 最新版的CnOCR 现在不可用,

所以又尝试自己安装 CnOCR http serv版,python3.9 pip使用的腾讯云的源,但是onnxruntime 更新到最新版之后,还是报错,请问onnxruntime 有指定的可以使用的版本么。

likohank avatar Jun 30 '25 01:06 likohank