Training: Remove test code from data loader.

This commit is contained in:
Brandon Amos 2016-02-28 13:48:22 -05:00
parent ccaf423904
commit 49d195355b
1 changed files with 21 additions and 22 deletions

View File

@ -76,25 +76,24 @@ end
--------------------------------------------------------------------------------
--[[ Section 2: Create a test data loader (testLoader), ]]--
if opt.testEpochSize > 0 then
if paths.filep(testCache) then
print('Loading test metadata from cache')
testLoader = torch.load(testCache)
else
print('Creating test metadata')
testLoader = dataLoader{
paths = {paths.concat(opt.data, 'val')},
loadSize = loadSize,
sampleSize = sampleSize,
-- split = 0,
split = 100,
verbose = true,
-- force consistent class indices between trainLoader and testLoader
forceClasses = trainLoader.classes
}
torch.save(testCache, testLoader)
end
collectgarbage()
end
-- End of test loader section
-- if opt.testEpochSize > 0 then
-- if paths.filep(testCache) then
-- print('Loading test metadata from cache')
-- testLoader = torch.load(testCache)
-- else
-- print('Creating test metadata')
-- testLoader = dataLoader{
-- paths = {paths.concat(opt.data, 'val')},
-- loadSize = loadSize,
-- sampleSize = sampleSize,
-- -- split = 0,
-- split = 100,
-- verbose = true,
-- -- force consistent class indices between trainLoader and testLoader
-- forceClasses = trainLoader.classes
-- }
-- torch.save(testCache, testLoader)
-- end
-- collectgarbage()
-- end
-- -- End of test loader section