EasyOCR icon indicating copy to clipboard operation
EasyOCR copied to clipboard

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

Open yuisunn opened this issue 10 months ago • 1 comments

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.

yuisunn avatar Apr 01 '24 09:04 yuisunn

use this

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

samthakur587 avatar May 07 '24 16:05 samthakur587