Skip to content

Instantly share code, notes, and snippets.

@szagoruyko
Created January 5, 2017 14:02
Show Gist options
  • Save szagoruyko/3747cf010f2bbcd0da2219dfc111f53c to your computer and use it in GitHub Desktop.
Save szagoruyko/3747cf010f2bbcd0da2219dfc111f53c to your computer and use it in GitHub Desktop.
commit 3948543212d3d8286a687ef7783783bae720f65f
Author: Sergey Zagoruyko <zagoruyko2@gmail.com>
Date: Mon Nov 21 18:01:56 2016 +0100
do gc only on val
diff --git a/dataloader.lua b/dataloader.lua
index a995bff..b69482a 100644
--- a/dataloader.lua
+++ b/dataloader.lua
@@ -79,7 +79,9 @@ function DataLoader:run()
batch[i]:copy(input)
target[i] = sample.target
end
- collectgarbage()
+ if _G.dataset.split == 'val' then
+ collectgarbage()
+ end
return {
input = batch:view(sz * nCrops, table.unpack(imageSize)),
target = target,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment