From 7973d9b4b5b3ef032c13410401b8c368220cd21d Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Fri, 1 Jun 2018 10:09:31 +0800 Subject: [PATCH] bug fix --- python/paddle/fluid/trainer.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python/paddle/fluid/trainer.py b/python/paddle/fluid/trainer.py index 3354d77acec..72168886fdb 100644 --- a/python/paddle/fluid/trainer.py +++ b/python/paddle/fluid/trainer.py @@ -178,10 +178,11 @@ class Trainer(object): exe.run(self.startup_program) if self.checkpoint and self.checkpoint.load_serial: - exe = executor.Executor(place) - io.load_checkpoint(exe, self.checkpoint.checkpoint_dir, - self.checkpoint.load_serial, - self.startup_program) + with self._prog_and_scope_guard(): + exe = executor.Executor(place) + io.load_checkpoint(exe, self.checkpoint.checkpoint_dir, + self.checkpoint.load_serial, + self.startup_program) if not self.checkpoint.is_pserver: epoch_id, step_id = io.load_trainer_args( -- GitLab