jiupinjia / stylized-neural-painting

Official Pytorch implementation of the preprint paper "Stylized Neural Painting", in CVPR 2021.

Home Page:https://jiupinjia.github.io/neuralpainter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

i can not use GPU

z-spider opened this issue · comments

hello
I tested this project on both win10 powershell and WSL, but it always uses my poor cpu, but I don't know how to check the cause of this problem.
I tried to execute the following statement in python:
"import torch"
"print(torch.cuda.is_available())"
It returns true in Powershell and false in WSL.
Of course, I managed to execute the example, but it took quite a while.

So I need some help, thank you.
please forgive my terrible english.

Hi @z-spider, if you got true from torch.cuda.is_available(), then the code will be running right on your GPU. Have you checked the GPU status like memory usage while running the code?

me.too
when i run ,i says
Traceback (most recent call last):
File "demo.py", line 4, in
torch.cuda.current_device()
File "C:\Users\xxiew\AppData\Roaming\Python\Python37\site-packages\torch\cuda_init_.py", line 384, in current_device
lazy_init()
File "C:\Users\xxiew\AppData\Roaming\Python\Python37\site-packages\torch\cuda_init
.py", line 186, in _lazy_init
check_driver()
File "C:\Users\xxiew\AppData\Roaming\Python\Python37\site-packages\torch\cuda_init
.py", line 61, in _check_driver
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled


i got false from torch.cuda.is_available()

Hi @whuxxie, thanks for your feedback. Can you try to clone this repo again and replace those py files in your local directory? I made an update yesterday where I have removed those torch.cuda.current_device() code lines.

Hi @z-spider, if you got true from torch.cuda.is_available(), then the code will be running right on your GPU. Have you checked the GPU status like memory usage while running the code?

I got true from the torch, but it still doesn't work.
This is my GPU, and I'm having no problems with memory usage.
Or is there anything else you'd recommend checking?
image

Hi @z-spider, did you receive any error report while running? How long does it take to process one image?

Hi @whuxxie, thanks for your feedback. Can you try to clone this repo again and replace those py files in your local directory? I made an update yesterday where I have removed those torch.cuda.current_device() code lines.

hi,i try just now ,it's ok,thank u very much.
without GPU,i find it very very slow.

Hi @z-spider, did you receive any error report while running? How long does it take to process one image?

I reinstalled the environment with conda and it now works, taking about thirteen minutes to process an image.
Before that, it took about several hours, which is too long.
I don't know why, but thanks again.

Yes it should be very slow on CPU. You can try to switch to lightweight renderers or using less strokes and see if there is any speed up.