Skip to content

Commit

Permalink
fix bug when checkpoint dir not ends with '/'
Browse files Browse the repository at this point in the history
  • Loading branch information
叔宝 committed Nov 13, 2024
1 parent bad99f5 commit 02811cf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions easy_rec/python/utils/estimator_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,8 +885,11 @@ def get_latest_checkpoint_from_checkpoint_path(checkpoint_path,
ignore_ckpt_error):
ckpt_path = None
if checkpoint_path.endswith('/') or gfile.IsDirectory(checkpoint_path + '/'):
if gfile.Exists(checkpoint_path):
ckpt_path = latest_checkpoint(checkpoint_path)
checkpoint_dir = checkpoint_path
if not checkpoint_dir.endswith('/'):
checkpoint_dir = checkpoint_dir + '/'
if gfile.Exists(checkpoint_dir):
ckpt_path = latest_checkpoint(checkpoint_dir)
if ckpt_path:
logging.info(
'fine_tune_checkpoint is directory, will use the latest checkpoint: %s'
Expand Down

0 comments on commit 02811cf

Please sign in to comment.