diff --git a/python/paddle/fluid/io.py b/python/paddle/fluid/io.py index 8e10b01a4abb0241cc55c03b00cb86ff73bb312d..62e3046db648689d6e197e156f829fa6d7bf5862 100644 --- a/python/paddle/fluid/io.py +++ b/python/paddle/fluid/io.py @@ -499,7 +499,8 @@ def save_checkpoint(executor, if is_chief: save_persist_vars_without_grad(executor, cur_dir, main_program) - _lru_delete(checkpoint_dir, max_num_checkpoints) + + _lru_delete(checkpoint_dir, max_num_checkpoints) def need_load_checkpoint(checkpoint_dir): diff --git a/python/paddle/fluid/trainer.py b/python/paddle/fluid/trainer.py index 69577a98fbd5a3b7f26730f4f6fdb518020b2ecf..b4f719855f4791a081c0ef4a9f06fd816dc65ff6 100644 --- a/python/paddle/fluid/trainer.py +++ b/python/paddle/fluid/trainer.py @@ -425,7 +425,7 @@ class Trainer(object): return self._get_parallel_executor() def _clean_checkpoint(self): - if not self.checkpoint and not self.chief: + if not self.checkpoint: return io.clean_checkpoint(checkpoint_dir=self.checkpoint.checkpoint_dir)