Training Model on CPU instead of GPU
I am using the transformer’strainer APIto train a BART model on server. The GPU space is enough, however, the training process only runs on CPU instead of GPU.I tried to usecudaandjitfromnumbalikethis exampleto add function decorators, but it still doesn’t help.What is the reason of it using CPU instead of GPU? How can I solve it and make the process run on GPU?Thank you for your help!
2021-09-08T12:21:18Z
The GPU will be automatically used by theTrainer, if that’s not the case, make sure you have properly installed your NVIDIA drivers and PyTorch.Basicallyimport torch
torch.cuda.is_available()should printTrue.