Skip to content
Snippets Groups Projects
Commit 1795d057 authored by Schneider Leo's avatar Schneider Leo
Browse files

model duo cuda error fix

parent 5123f205
No related branches found
No related tags found
No related merge requests found
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment