Bug fix to get_latest_run when recent run is named

This commit is contained in:
Alex Stoken 2020-07-07 11:19:49 -05:00
parent 52bac22f09
commit 95f0a56df7
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ def init_seeds(seed=0):
def get_latest_run(search_dir = './runs'): def get_latest_run(search_dir = './runs'):
# get path to most recent 'last.pt' in run dirs # get path to most recent 'last.pt' in run dirs
# assumes most recently saved 'last.pt' is the desired weights to --resume from # assumes most recently saved 'last.pt' is the desired weights to --resume from
last_list = glob.glob(f'{search_dir}/**/last.pt', recursive=True) last_list = glob.glob(f'{search_dir}/**/last*.pt', recursive=True)
latest = max(last_list, key = os.path.getctime) latest = max(last_list, key = os.path.getctime)
return latest return latest