Skip to content

Commit

Permalink
fix bug when checkpoint dir not ends with '/' (#502)
Browse files Browse the repository at this point in the history
Co-authored-by: 叔宝 <[email protected]>
  • Loading branch information
paradiseHIT and 叔宝 authored Nov 14, 2024
1 parent 94dce1a commit e62f252
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 e62f252

Please sign in to comment.