I have searched on here but I found only outdated posts.
I want to run the training on my GPU. I found on some forums that I need to apply .cuda()
on anything I want to use CUDA with (I've applied it to everything I could without making the program crash)
Surprisingly, this makes the training even slower.
Then, I found that you could use this torch.set_default_tensor_type('torch.cuda.FloatTensor')
to use CUDA. With both enabled, nothing changes. What is happening?
Is there a way to reliably enable CUDA on the whole model?
EDIT: This was flagged as a duplicate. It isn't. The post I was linked to didn't answer all of my questions.
Also, what does MyModel()
mean? I need more tangible examples, like code examples. (This is the post I am referring to)