iuliaturc / detextify

Remove text from AI-generated images
MIT License
263 stars 21 forks source link

Exception: You need a GPU + CUDA to run this model locally. #31

Closed jameswan closed 1 year ago

jameswan commented 1 year ago

Unsure why I am getting this error when there is GPU and CUDA already installed.

Traceback (most recent call last): File "C:\Users\James\Desktop\detextify\detext.py", line 19, in detextifier = Detextifier(PaddleTextDetector(), LocalSDInpainter()) File "C:\Users\James\anaconda3\envs\tf\lib\site-packages\detextify\inpainter.py", line 155, in init raise Exception("You need a GPU + CUDA to run this model locally.") Exception: You need a GPU + CUDA to run this model locally.

(tf) C:\Users\James\Desktop\detextify>python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))" [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU'), PhysicalDevice(name='/physical_device:GPU:1', device_type='GPU')]

jameswan commented 1 year ago

Solved.

In Anaconda

  1. Create environment with Python 3.8
  2. Install PyTorch for GPU
  3. pip install paddlepaddle-gpu -i https://mirror.baidu.com/pypi/simple
  4. pip install detextify
rbychn commented 1 year ago

I did all this and am still getting the same error, is there another fix?

jameswan commented 1 year ago

I did all this and am still getting the same error, is there another fix?

What's your error? Did you check if torch is installed properly? That's typically the problem spot

rbychn commented 1 year ago

Used some details from here and fixed it. Now it's not able to find tesseract on my windows even though when I do tesseract -v it is able to show me the details.