easyocr WARNING CUDA not available - defaulting to CPU. Note: This module is much faster with a GPU

7.8k Views Asked by At

I reference this post to check my cuda driver. It's meet the requirements. But torch still can't use GPU.

operating system info: Windows 10

package and env info:

(.env) PS E:\TMP> nvidia-smi
Tue Dec 20 14:25:12 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 512.77       Driver Version: 512.77       CUDA Version: 11.6     |

(.env) PS E:\TMP> python
Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
False

(.env) PS E:\TMP> pip freeze
...
easyocr==1.6.2
opencv-python==4.6.0.66
opencv-python-headless==4.5.4.60
torch==1.13.1
torchaudio==0.13.1+cu116
torchvision==0.14.1

Any help will appreciate.

2

There are 2 best solutions below

0
On

Currently, PyTorch on Windows only supports Python 3.7-3.9; Python 2.x is not supported.

Ref

Change python version to 3.8 can work.

0
On

I had the same issue. After searching for a while, I found on the JaidedAI/EasyOCR github repository the following note:

For Windows, please install torch and torchvision first by following the official instructions here https://pytorch.org. On the pytorch website, be sure to select the right CUDA version you have. If you intend to run on CPU mode only, select CUDA = None.

After uninstalling torch and easyOCR, I reinstalled torch first, and then reinstalled easyOCR. It seems to have fixed the issue.

Hope this helps.