JaidedAI / EasyOCR

Ready-to-use OCR with 80+ supported languages and all popular writing scripts including Latin, Chinese, Arabic, Devanagari, Cyrillic and etc.
https://www.jaided.ai
Apache License 2.0
24.52k stars 3.16k forks source link

pyinstaller error #1291

Closed yancccc closed 3 months ago

yancccc commented 3 months ago

import easyocr reader = easyocr.Reader(['ch_sim','en']) # this needs to run only once to load the model into memory result = reader.readtext('1.jpg',detail = 0,paragraph="False") print(result) use pyinstaller error: Traceback (most recent call last): File "1.py", line 3, in result = reader.readtext('1.jpg',detail = 0,paragraph="False") File "easyocr/easyocr.py", line 456, in readtext horizontal_list, free_list = self.detect(img, File "easyocr/easyocr.py", line 321, in detect text_box_list = self.get_textbox(self.detector, File "easyocr/detection.py", line 95, in get_textbox bboxes_list, polys_list = test_net(canvas_size, mag_ratio, detector, File "easyocr/detection.py", line 46, in test_net y, feature = net(x) File "torch/nn/modules/module.py", line 1553, in _wrapped_call_impl File "torch/nn/modules/module.py", line 1562, in _call_impl File "torch/nn/parallel/data_parallel.py", line 184, in forward File "torch/nn/modules/module.py", line 1553, in _wrapped_call_impl File "torch/nn/modules/module.py", line 1562, in _call_impl File "easyocr/craft.py", line 60, in forward sources = self.basenet(x) File "torch/nn/modules/module.py", line 1553, in _wrapped_call_impl File "torch/nn/modules/module.py", line 1562, in _call_impl File "easyocr/model/modules.py", line 68, in forward h = self.slice1(X) File "torch/nn/modules/module.py", line 1553, in _wrapped_call_impl File "torch/nn/modules/module.py", line 1562, in _call_impl File "torch/nn/modules/container.py", line 219, in forward File "torch/nn/modules/module.py", line 1553, in _wrapped_call_impl File "torch/nn/modules/module.py", line 1562, in _call_impl File "torch/nn/modules/conv.py", line 458, in forward File "torch/nn/modules/conv.py", line 454, in _conv_forward RuntimeError: CUDNN_BACKEND_TENSOR_DESCRIPTOR cudnnFinalize failed cudnn_status: CUDNN_STATUS_NOT_INITIALIZED

yancccc commented 3 months ago

The CPU runs fine, but the GPU runs with an error

yancccc commented 3 months ago

(ocr) ps@ps:~/ycc/ocr/EasyOCR-master$ nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on Wed_Sep_21_10:33:58_PDT_2022 Cuda compilation tools, release 11.8, V11.8.89 Build cuda_11.8.r11.8/compiler.31833905_0 (ocr) ps@ps:~/ycc/ocr/EasyOCR-master$ cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2

define CUDNN_MAJOR 8

define CUDNN_MINOR 9

define CUDNN_PATCHLEVEL 7

--

define CUDNN_VERSION (CUDNN_MAJOR 1000 + CUDNN_MINOR 100 + CUDNN_PATCHLEVEL)

/ cannot use constexpr here since this is a C-only file /