From 0211c5df0a12de2647b339dc0a8c36d35209a1a3 Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Wed, 30 May 2018 11:45:25 +0800 Subject: [PATCH] bug fix --- python/paddle/fluid/trainer.py | 17 +++++++++-------- tools/codestyle/docstring_checker.pyc | Bin 0 -> 12561 bytes 2 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 tools/codestyle/docstring_checker.pyc diff --git a/python/paddle/fluid/trainer.py b/python/paddle/fluid/trainer.py index 5ca93821e2..34db9b39b7 100644 --- a/python/paddle/fluid/trainer.py +++ b/python/paddle/fluid/trainer.py @@ -139,13 +139,14 @@ class Trainer(object): self.trainer_id = 0 self.chief = True self.checkpoint = checkpoint_config - if self.checkpoint and \ - not isinstance(self.checkpoint, CheckpointConfig): - raise TypeError( - "The checkpoint_config shoule be an instance of CheckpointConfig" - ) - self.checkpoint._load_serial = io.need_load_checkpoint( - self.checkpoint.checkpoint_dir) + if self.checkpoint: + if not isinstance(self.checkpoint, CheckpointConfig): + raise TypeError( + "The checkpoint_config shoule be an instance of CheckpointConfig" + ) + else: + self.checkpoint._load_serial = io.need_load_checkpoint( + self.checkpoint.checkpoint_dir) self.scope = core.Scope() @@ -175,7 +176,7 @@ class Trainer(object): exe = executor.Executor(place) exe.run(self.startup_program) - if self.checkpoint._load_serial: + if self.checkpoint and self.checkpoint._load_serial: exe = executor.Executor(place) io.load_checkpoint(exe, self.checkpoint.checkpoint_dir, self.checkpoint._load_serial, diff --git a/tools/codestyle/docstring_checker.pyc b/tools/codestyle/docstring_checker.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f0255b763c8d154b7cc17d2d525148dfea3b42d GIT binary patch literal 12561 zcmdT~Npl;=7488*kbt;or54N9SSu6>B(+$!8Cn)4%CZuRQVr#(M2iK3m?1gT00T}B zEYg-Lm69vVF}LI&q$*W8rE*K<5Z`=Een4`}DTh=}i7WZO*Mk8_(T-GhiZsb-cE9fF z<@MX&WdAWx{QTCy2Q`)aWbywB9{o!cu2Q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