williamSYSU / TextGAN-PyTorch

TextGAN is a PyTorch framework for Generative Adversarial Networks (GANs) based text generation models.
MIT License
892 stars 205 forks source link

Execution in CPU-only Mode #55

Open malikeh1375 opened 3 years ago

malikeh1375 commented 3 years ago

I am running the codes on macOS without NVIDIA GPU Graphic Card available. I wonder how I can run the scripts in CPU-only mode. What sections should I modify?

Thanks in advance!

doublequeens commented 3 years ago

same question, any solution?

FabienCharmet commented 3 years ago

In pytorch you can call the .to() function to attach a device to another GPU / CPU.

tensor.to('cpu') should attach the tensor to the CPU of your computer. However, I believe that quite a lot of tensors should be reattched so I would recommend that you be careful with this.

HernandezEduin commented 2 years ago

You can set CUDA = int(False) in the run_[model].py.