AttnGAN
AttnGAN copied to clipboard
Not being able to train on CPU even though I altered trainer.py
In another issue about training on CPU, I read this fix:
"_trainer.py has lots of cuda() calls without asking about the CUDA flag set in config file, so evaluation/training on a CPU is not possible.
I fixed the issue by adding "if cfg.CUDA" loops before every cuda() call and it works just fine_"
This fix still doesn't enable me to evaluate and train on CPU... I keep on getting this error: AttributeError: module 'torch._C' has no attribute '_cuda_getDevice Does anybody know how I can fix this please?
Hi
In ./code/trainer.py
line 36:
if you change torch.cuda.set_device(cfg.GPU_ID)
to torch.cuda.set_device(-1)
it should work.
You're hardcoding it to use CPU mode though, so be aware.