fastai / course22

The fast.ai course notebooks
https://course.fast.ai
2.4k stars 937 forks source link

How to make the code run using the local gpu #62

Open SKBL5694 opened 1 year ago

SKBL5694 commented 1 year ago

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?

CaseyHaralson commented 11 months ago

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()