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')