DmitryUlyanov / texture_nets

Code for "Texture Networks: Feed-forward Synthesis of Textures and Stylized Images" paper.
Apache License 2.0
1.22k stars 218 forks source link

Will it be faster to train a model on GPU rather than a CPU? how can I make it support OpenCL? #55

Closed 0000sir closed 7 years ago

0000sir commented 7 years ago

I'm trying to train some model, it takes many many hours to generate one. Actually I haven't got any of it after running scripts a whole day. Is it better to train it on a GPU?

I have a AMD R2 920, but no NVIDIA, how to make this script runs on my AMD GPU?

Thank you.

DmitryUlyanov commented 7 years ago

Yes, it's better to use GPU. Only NVIDIA GPU's supported, for now, but as a hack try to change this line

https://github.com/DmitryUlyanov/texture_nets/blob/master/train.lua#L66

to dtype = 'torch.ClTensor', replace all require 'cutorch' with require 'cltorch' and remove all cudnn related stuff. I do not have AMD GPU so I cannot test it and push a commit myself.

0000sir commented 7 years ago

Thank you but never mind, I bought a nvidia GTX1080 yestoday, it's working good, trying to get good results. I will try it if place the AMD GPU back.