From 89604310e4fe79fce4cb5f024d4b61ac4d3d1618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=94=E5=AE=9D?= Date: Wed, 28 Aug 2024 16:47:41 +0800 Subject: [PATCH] fix checkpoint_path error when use oss://xxx/yyy. if yyy is a dir, it needs to add a '/' at the end --- easy_rec/python/utils/estimator_utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/easy_rec/python/utils/estimator_utils.py b/easy_rec/python/utils/estimator_utils.py index a90f0b0f0..ea15063d1 100644 --- a/easy_rec/python/utils/estimator_utils.py +++ b/easy_rec/python/utils/estimator_utils.py @@ -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'