diff --git a/main.py b/main.py index 84240bfe981ded28e301f923e21854b160622b47..db56d0fb7b780db4446a4c6a6926e7e46be48de4 100644 --- a/main.py +++ b/main.py @@ -137,6 +137,7 @@ def train_duo(model, data_train, optimizer, loss_function, epoch): if torch.cuda.is_available(): imaer = imaer.cuda() imana = imana.cuda() + label = label.cuda() pred_logits = model.forward(imaer,imana) pred_class = torch.argmax(pred_logits,dim=1) acc += (pred_class==label).sum().item() @@ -162,6 +163,7 @@ def test_duo(model, data_test, loss_function, epoch): if torch.cuda.is_available(): imaer = imaer.cuda() imana = imana.cuda() + label = label.cuda() pred_logits = model.forward(imaer,imana) pred_class = torch.argmax(pred_logits,dim=1) acc += (pred_class==label).sum().item() @@ -220,6 +222,7 @@ def make_prediction_duo(model, data, f_name): if torch.cuda.is_available(): imaer = imaer.cuda() imana = imana.cuda() + label = label.cuda() output = model(imaer,imana) output = (torch.max(torch.exp(output), 1)[1]).data.cpu().numpy()