From 4d07ec8a2ab335cd55c7864b53237538081053a6 Mon Sep 17 00:00:00 2001 From: jacobdang Date: Fri, 23 Dec 2016 21:01:01 +0800 Subject: [PATCH] patch for fix 32 --- train/test.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/train/test.lua b/train/test.lua index 8f45ea9..888ecdf 100644 --- a/train/test.lua +++ b/train/test.lua @@ -104,8 +104,7 @@ function test(testData, classes, epoch, trainConf, model, loss ) if totalerr < testData.preverror then filename = paths.concat(opt.save, 'model-best.net') print('==> saving model to '..filename) - - torch.save(filename, model:clearState():get(1)) + torch.save(filename, model:clearState()) -- update to min error: if opt.noConfusion == 'tes' or opt.noConfusion == 'all' then coTotalLogger:add{['confusion total accuracy'] = teconfusion.totalValid * 100 } @@ -145,7 +144,7 @@ function test(testData, classes, epoch, trainConf, model, loss ) local filename = paths.concat(opt.save, 'model-'..epoch..'.net') --os.execute('mkdir -p ' .. sys.dirname(filename)) print('==> saving model to '..filename) - torch.save(filename, model:clearState():get(1)) + torch.save(filename, model:clearState()) if opt.noConfusion == 'tes' or opt.noConfusion == 'all' then -- update to min error: filename = paths.concat(opt.save, 'confusionMatrix-' .. epoch .. '.txt')