I am using QuestionAnsweringModel from SimpleTransformers. When I run my code, and review my processes in Windows Task Manager, python is not using my GPU at all. I have included a code snippet to recreate the problem. Any help is highly appreciated.
import torch
from simpletransformers.question_answering import QuestionAnsweringModel, QuestionAnsweringArgs
model_type=“bert”
model_name= “bert-base-cased”
model_args = QuestionAnsweringArgs()
train_args = {
“n_best_size”:1 ,
‘overwrite_output_dir’: True,
‘show_running_loss’:True,
‘n_gpu’: 3
}
model = QuestionAnsweringModel(model_type,model_name, args=train_args, use_cuda=True)
I have tried
model.to(torch.device(“cuda:0” if torch.cuda.is_available() else “cpu”))
to set the device to cuda. But I am having no luck.
I have also looked at a topic on the same issue here before. Recommendations were to update pytorch. But I have already done that as well.
Thanks!