Skip to content

Commit

Permalink
Update gnn.py
Browse files Browse the repository at this point in the history
GPU Out of memory issue problem.
  • Loading branch information
engrodawood authored Jun 5, 2023
1 parent 20e8804 commit 786197a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions workspace/model/gnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ def forward(self, data):
import torch.nn.functional as F
for layer in range(self.no_layers):
if layer == 0:
# Uncomment this line and use smaller size for node level features if you are
# facing GPU memory problem.
#x = self.first_h(x)
# import pdb; pdb.set_trace()
z = self.linears[layer](x)
Z += z
dout = F.dropout(pooling(z, batch),
Expand Down Expand Up @@ -455,4 +456,4 @@ def train(self, train_loader, max_epochs=100, optimizer=torch.optim.Adam, schedu
test_pr = test_pr_at_best_val_acc

Q.reverse()
return Q, train_loss, train_acc, val_loss, np.round(val_acc, 2), test_loss, np.round(test_acc, 2), val_pr, test_pr
return Q, train_loss, train_acc, val_loss, np.round(val_acc, 2), test_loss, np.round(test_acc, 2), val_pr, test_pr

0 comments on commit 786197a

Please sign in to comment.