How i Train With CPU

I want to train cnn model using cpu, i switched from cuda to cpu but it gives me cuda out of memory
that means that run on cuda. I used these lines but not working
defaults.device = torch.device('cpu')

HI alymostafa hope your having a marvelous day!

The links below seem to suggest that this is a possible solution.

you can just set CUDA_VISIBLE_DEVICES variable to empty via shell before running your torch code.


should tell torch that there are no GPUs.

will tell it to use only one GPU (the one with id 0) and so on

Hope this helps

Cheers mrfabulous1 :smiley: :smiley: