Unverified 提交 cbe39a1d authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Update utils.py

上级 c654d18f
...@@ -36,12 +36,12 @@ def init_seeds(seed=0): ...@@ -36,12 +36,12 @@ def init_seeds(seed=0):
np.random.seed(seed) np.random.seed(seed)
torch_utils.init_seeds(seed=seed) torch_utils.init_seeds(seed=seed)
def get_latest_run(search_dir = './runs'): def get_latest_run(search_dir = './runs'):
# get path to most recent 'last.pt' in run dirs # Return path to most recent 'last.pt' in /runs (i.e. 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) return max(last_list, key = os.path.getctime)
return latest
def check_git_status(): def check_git_status():
# Suggest 'git pull' if repo is out of date # Suggest 'git pull' if repo is out of date
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论