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
23k stars 3.03k forks source link

RuntimeError: CUDA error: the launch timed out and was terminated #1237

Open yuisunn opened 3 months ago

yuisunn commented 3 months ago

Sometimes this error will be reported torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 li_txts = self.ocr.readtext(img_arry) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\anaconda3\Lib\site-packages\easyocr\easyocr.py", line 452, in readtext horizontal_list, free_list = self.detect(img, ^^^^^^^^^^^^^^^^ File "C:\Users\anaconda3\Lib\site-packages\easyocr\easyocr.py", line 321, in detect text_box_list = self.get_textbox(self.detector, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\anaconda3\Lib\site-packages\easyocr\detection.py", line 95, in get_textbox bboxes_list, polys_list = test_net(canvas_size, mag_ratio, detector, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\anaconda3\Lib\site-packages\easyocr\detection.py", line 51, in test_net score_text = out[:, :, 0].cpu().data.numpy() ^^^^^^^^^^^^^^^^^^ RuntimeError: CUDA error: the launch timed out and was terminated CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1. Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.

samthakur587 commented 2 months ago

use this

conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch