From 063474b2eaa65acd1c56378b6e6b46e830803c96 Mon Sep 17 00:00:00 2001 From: nagadomi Date: Thu, 13 Apr 2017 17:38:18 +0900 Subject: [PATCH] Fix clearState --- train.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/train.lua b/train.lua index aa8137d..26a416c 100644 --- a/train.lua +++ b/train.lua @@ -543,8 +543,9 @@ local function train() best_score = score_for_update print("* model has updated") if settings.save_history then - torch.save(settings.model_file_best, model:clearState(), "ascii") - torch.save(string.format(settings.model_file, epoch, i), model:clearState(), "ascii") + pmodel:clearState() + torch.save(settings.model_file_best, model, "ascii") + torch.save(string.format(settings.model_file, epoch, i), model, "ascii") if settings.method == "noise" then local log = path.join(settings.model_dir, ("noise%d_best.%d-%d.png"):format(settings.noise_level, @@ -568,7 +569,8 @@ local function train() save_test_user(model, test_image, log) end else - torch.save(settings.model_file, model:clearState(), "ascii") + pmodel:clearState() + torch.save(settings.model_file, model, "ascii") if settings.method == "noise" then local log = path.join(settings.model_dir, ("noise%d_best.png"):format(settings.noise_level))