提交 0211c5df 编写于 作者: T tangwei12

bug fix

上级 93570789
...@@ -139,11 +139,12 @@ class Trainer(object): ...@@ -139,11 +139,12 @@ class Trainer(object):
self.trainer_id = 0 self.trainer_id = 0
self.chief = True self.chief = True
self.checkpoint = checkpoint_config self.checkpoint = checkpoint_config
if self.checkpoint and \ if self.checkpoint:
not isinstance(self.checkpoint, CheckpointConfig): if not isinstance(self.checkpoint, CheckpointConfig):
raise TypeError( raise TypeError(
"The checkpoint_config shoule be an instance of CheckpointConfig" "The checkpoint_config shoule be an instance of CheckpointConfig"
) )
else:
self.checkpoint._load_serial = io.need_load_checkpoint( self.checkpoint._load_serial = io.need_load_checkpoint(
self.checkpoint.checkpoint_dir) self.checkpoint.checkpoint_dir)
...@@ -175,7 +176,7 @@ class Trainer(object): ...@@ -175,7 +176,7 @@ class Trainer(object):
exe = executor.Executor(place) exe = executor.Executor(place)
exe.run(self.startup_program) exe.run(self.startup_program)
if self.checkpoint._load_serial: if self.checkpoint and self.checkpoint._load_serial:
exe = executor.Executor(place) exe = executor.Executor(place)
io.load_checkpoint(exe, self.checkpoint.checkpoint_dir, io.load_checkpoint(exe, self.checkpoint.checkpoint_dir,
self.checkpoint._load_serial, self.checkpoint._load_serial,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册