rpryzant / delete_retrieve_generate

PyTorch implementation of the Delete, Retrieve Generate style transfer algorithm
MIT License
132 stars 26 forks source link

can you help me. how to use gpu? #16

Closed zhunipingan closed 4 years ago

zhunipingan commented 4 years ago

hi, I want to use gpu to run the code. As I found that it cost too much time on cpu. but I don't know how to achieve this goals in your code. can you tell me how to do? maybe the question is not too hard, but I have tried a lot. thanks!

rpryzant commented 4 years ago

Thanks for reaching out!

So what happens when you run nvidia-smi in your bash prompt?

If your GPU is set up properly you should see something like this https://i.stack.imgur.com/JyWHR.png

and the system should automatically see the gpu and use it. (the logic for that is here: https://github.com/rpryzant/delete_retrieve_generate/blob/master/src/cuda.py)

zhunipingan commented 4 years ago

Thanks for your timely reply! I can run on gpu now, it need nearly 1.5h to run one epoch. Thank you!!!! best wishes~