diff --git a/python/paddle/fluid/io.py b/python/paddle/fluid/io.py index 75146fe3269ad2a799d8a8676e56cf4567b957f1..111907b57516a87dab3090dcbb6b042a4d979f25 100644 --- a/python/paddle/fluid/io.py +++ b/python/paddle/fluid/io.py @@ -25,7 +25,7 @@ __all__ = [ 'load_persistables', 'save_inference_model', 'load_inference_model', 'get_inference_program', 'save_checkpoint', 'load_checkpoint', 'clean_checkpoint', 'load_persist_vars_without_grad', - 'save_persist_vars_without_grad' + 'save_persist_vars_without_grad', 'get_latest_checkpoint_serial' ] @@ -503,7 +503,7 @@ def save_checkpoint(executor, _lru_delete(checkpoint_dir, max_num_checkpoints) -def need_load_checkpoint(checkpoint_dir): +def get_latest_checkpoint_serial(checkpoint_dir): """ If the directory have checkpoint files, it will return lastest checkpoint directory serial number diff --git a/python/paddle/fluid/trainer.py b/python/paddle/fluid/trainer.py index 72168886fdba4d3f9dd9982803c4ba8e1ef2a5cf..3c32ec1de8a97ae088087e5fb1e6bd364ddbf23d 100644 --- a/python/paddle/fluid/trainer.py +++ b/python/paddle/fluid/trainer.py @@ -146,7 +146,7 @@ class Trainer(object): "The checkpoint_config shoule be an instance of CheckpointConfig" ) else: - self.checkpoint.load_serial = io.need_load_checkpoint( + self.checkpoint.load_serial = io.get_latest_checkpoint_serial( self.checkpoint.checkpoint_dir) self.scope = core.Scope()