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.24k stars 3.15k forks source link

Using GPU in the training #1320

Open RamadanHussein opened 1 week ago

RamadanHussein commented 1 week ago

I'm training EasyOCR and noticed that the training is using the CPU while the machine has a GPU with tensors , any configuration hat can help to force the model to use the GPU

CPU vs  GPU

akachammile commented 1 week ago

you can run torch.cuda.is_available() to test gpu is available

RamadanHussein commented 1 week ago

Yes it is available however I noticed this behavior that it doesn't use the cuda , is this due to the torch version because I'm using 12.2 while my GPU card is RTX 4090

romanvelichkin commented 1 week ago

Are you using trainer.ipynb from this repo? Because it works for me.

is this due to the torch version because I'm using 12.2

You're probably talking about CUDA version, not torch version. I would recommend create python environment specifically for EasyOCR, because it will install proper pytorch and cuda versions it needs. Otherwise you could have your own versions or overwrite EasyOCR confing with different versions.