From f1777ea2834f6623e07c250cc409c63144a9cad3 Mon Sep 17 00:00:00 2001 From: xujiaqi01 <173596896@qq.com> Date: Thu, 11 Jun 2020 11:02:15 +0800 Subject: [PATCH] fix single_infer (#66) * fix single_infer --- core/trainers/single_infer.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/trainers/single_infer.py b/core/trainers/single_infer.py index fcc92e2e..235e101e 100755 --- a/core/trainers/single_infer.py +++ b/core/trainers/single_infer.py @@ -198,7 +198,7 @@ class SingleInfer(TranspileTrainer): def executor_train(self, context): epochs = int( - envs.get_global_env("runner." + self._runner_name + ".epochs")) + envs.get_global_env("runner." + self._runner_name + ".epochs", 1)) for j in range(epochs): for model_dict in self._env["phase"]: if j == 0: @@ -298,8 +298,6 @@ class SingleInfer(TranspileTrainer): batch_id += 1 except fluid.core.EOFException: reader.reset() - with open(model_dict['save_path'], 'w') as fout: - json.dump(infer_results, fout) def terminal(self, context): context['is_exit'] = True -- GitLab