Open 0shelter0 opened 2 years ago
Nope,, the present version doesn't support GPU. It can support GPU through the following modifications: (1) modification in the main.py file, add the following statement at the beggining: device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") (2)modification in the train.py file: --- add the following statement at the beggining: model.to(device) --- modification to all the existing statements X = trainX[start_idx: end_idx] TE = trainTE[start_idx: end_idx] label = trainY[start_idx: end_idx] as followings: X = trainX[start_idx: end_idx].to(device) TE = trainTE[start_idx: end_idx].to(device) label = trainY[start_idx: end_idx].to(device) (3) in the test.py file, the similar modification should be made as the above-mentioned in item(2).
Hope it could be helpful to you.
Nope,, the present version doesn't support GPU. It can support GPU through the following modifications: (1) modification in the main.py file, add the following statement at the beggining: device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") (2)modification in the train.py file: --- add the following statement at the beggining: model.to(device) --- modification to all the existing statements X = trainX[start_idx: end_idx] TE = trainTE[start_idx: end_idx] label = trainY[start_idx: end_idx] as followings: X = trainX[start_idx: end_idx].to(device) TE = trainTE[start_idx: end_idx].to(device) label = trainY[start_idx: end_idx].to(device) (3) in the test.py file, the similar modification should be made as the above-mentioned in item(2).
Hope it could be helpful to you.
Try as you said and report an error: RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensor
I run a epoch cost too long to continue, I want to PR this project to made it to be adaptive to use gpu(s).