DmitryUlyanov / deep-image-prior

Image restoration with neural networks but without learning.
https://dmitryulyanov.github.io/deep_image_prior
Other
7.84k stars 1.43k forks source link

Running on GPU #13

Closed philtomson closed 6 years ago

philtomson commented 6 years ago

I copied the code from denoising.ipynb into denoising.py just to ensure that jupyter wasn't the issue and than ran python denoising.py - it seemed very slow, so I checked nvidia-smi and noticed that the GPU wasn't being used.

I then tried:

$python -c 'import torch; print(torch.rand(2,3).cuda())' $nvidia-smi (in another window)

and noticed that the GPU was being used in that case.

I noticed the line:

os.environ['CUDA_VISIBLE_DEVICES'] = '1'

and uncommented it, but it made no difference. It looks like the code is setup to run on GPU (dtype = torch.cuda.FloatTensor), but it doesn't seem to be running on the GPU.