course22 icon indicating copy to clipboard operation
course22 copied to clipboard

How to make the code run using the local gpu

Open SKBL5694 opened this issue 2 years ago • 1 comments
trafficstars

I run the notebook on my PC, when I use learn.fintune(), I found that the time consumed is far higher than mentioned in the notes, I found that this is due to training using cpu instead of gpu, because when I run the code, the memory use of GPU doesn't increase. How can I solve the problem?

SKBL5694 avatar Mar 16 '23 07:03 SKBL5694

I run the notebook on my PC, when I use learn.fintune(), I found that the time consumed is far higher than mentioned in the notes, I found that this is due to training using cpu instead of gpu, because when I run the code, the memory use of GPU doesn't increase. How can I solve the problem?

Try running this in a notebook to see if CUDA is available. If you get a False output then you need to fix the torch install. Try installing the correct thing from here: https://pytorch.org/get-started/locally/

import torch
torch.cuda.is_available()

CaseyHaralson avatar Oct 01 '23 16:10 CaseyHaralson