breezedeus / CnOCR

CnOCR: Awesome Chinese/English OCR Python toolkits based on PyTorch. It comes with 20+ well-trained models for different application scenarios and can be used directly after installation. 【基于 PyTorch/MXNet 的中文/英文 OCR Python 包。】

Home Page:https://www.breezedeus.com/article/cnocr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

安装好cnocr后对图片检测报错

Yanxiaotong opened this issue · comments

EP Error /onnxruntime_src/onnxruntime/core/session/provider_bridge_ort.cc:1193 onnxruntime::Provider& onnxruntime::ProviderLibrary::Get() [ONNXRuntimeError] : 1 : FAIL : Failed to load library libonnxruntime_providers_tensorrt.so with error: libnvinfer.so.8: cannot open shared object file: No such file or directory
when using ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'AzureExecutionProvider', 'CPUExecutionProvider']
Falling back to ['CUDAExecutionProvider', 'CPUExecutionProvider'] and retrying.
2023-12-19 10:31:07.020840241 [E:onnxruntime:, inference_session.cc:1785 operator()] Exception during initialization: /onnxruntime_src/onnxruntime/core/providers/cuda/cuda_call.cc:121 std::conditional_t<THRW, void, onnxruntime::common::Status> onnxruntime::CudaCall(ERRTYPE, const char*, const char*, ERRTYPE, const char*, const char*, int) [with ERRTYPE = cudnnStatus_t; bool THRW = true; std::conditional_t<THRW, void, onnxruntime::common::Status> = void] /onnxruntime_src/onnxruntime/core/providers/cuda/cuda_call.cc:114 std::conditional_t<THRW, void, onnxruntime::common::Status> onnxruntime::CudaCall(ERRTYPE, const char*, const char*, ERRTYPE, const char*, const char*, int) [with ERRTYPE = cudnnStatus_t; bool THRW = true; std::conditional_t<THRW, void, onnxruntime::common::Status> = void] CUDNN failure 1: CUDNN_STATUS_NOT_INITIALIZED ; GPU=0 ; hostname=ubuntu ; file=/onnxruntime_src/onnxruntime/core/providers/cuda/cuda_execution_provider.cc ; line=172 ; expr=cudnnCreate(&cudnn_handle_);

Traceback (most recent call last):
File "detect.py", line 4, in
ocr = CnOcr()
File "/home/user/anaconda3/envs/yxt/lib/python3.8/site-packages/cnocr/cn_ocr.py", line 155, in init
self.rec_model = rec_cls(
File "/home/user/anaconda3/envs/yxt/lib/python3.8/site-packages/cnocr/recognizer.py", line 142, in init
self._model = self._get_model(context)
File "/home/user/anaconda3/envs/yxt/lib/python3.8/site-packages/cnocr/recognizer.py", line 197, in _get_model
model = ort.InferenceSession(
AttributeError: module 'onnxruntime' has no attribute 'InferenceSession'

解决了,upgrade了onnxruntime的包