Skip to content
This repository was archived by the owner on Jan 8, 2021. It is now read-only.

Commit 7543197

Browse files
committed
Try to empty cache before exiting
1 parent 625bdb4 commit 7543197

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Train.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,5 @@ def train(EPOCH, dataloader, test_dataloader, optimizer, loss_function, network,
150150
test_loader = data.DataLoader(dataset = test_data, batch_size = BATCH_SIZE, shuffle = False)
151151
optimizer = torch.optim.Adam(network.parameters(), lr = LR)
152152
train(EPOCH, train_loader, test_loader, optimizer, loss_func, network, model_name, negative_loss, args.device, should_view, f)
153-
f.close()
153+
f.close()
154+
torch.cuda.empty_cache()

0 commit comments

Comments
 (0)