diff --git a/python/paddle/fluid/io.py b/python/paddle/fluid/io.py index ed560304e25fd9b5a5d8776051190e0ab984550a..2925e8eb2894f77b81920d965998404b3f9386c4 100644 --- a/python/paddle/fluid/io.py +++ b/python/paddle/fluid/io.py @@ -529,7 +529,6 @@ def load_checkpoint(executor, checkpoint_dir, serial, main_program): raise ValueError("The values of 'main_program'should not be None") cur_dir = _get_serial_dir(checkpoint_dir, serial) - cur_dir = _get_model_dir(cur_dir) load_persist_vars_without_grad(executor, cur_dir, main_program) diff --git a/python/paddle/fluid/trainer.py b/python/paddle/fluid/trainer.py index 35bb8ded5d9065cadd0140a3459b0b10e7fdb998..5ca93821e229b7785f46fbce07dc02b06579f5f1 100644 --- a/python/paddle/fluid/trainer.py +++ b/python/paddle/fluid/trainer.py @@ -144,7 +144,7 @@ class Trainer(object): raise TypeError( "The checkpoint_config shoule be an instance of CheckpointConfig" ) - self.load_checkpoint_serial = io.need_load_checkpoint( + self.checkpoint._load_serial = io.need_load_checkpoint( self.checkpoint.checkpoint_dir) self.scope = core.Scope() @@ -182,7 +182,7 @@ class Trainer(object): self.startup_program) epoch_id, step_id = io.load_trainer_args( - self.checkpoint.checkpoint_dir, self.load_checkpoint_serial, + self.checkpoint.checkpoint_dir, self.checkpoint._load_serial, self.trainer_id, ["epoch_id", "step_id"]) self.checkpoint._epoch_id = int(epoch_id) self.checkpoint._step_id = int(step_id)