Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher authored Jul 8, 2020
1 parent c654d18 commit cbe39a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ def init_seeds(seed=0):
np.random.seed(seed)
torch_utils.init_seeds(seed=seed)


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


def check_git_status():
# Suggest 'git pull' if repo is out of date
Expand Down

0 comments on commit cbe39a1

Please sign in to comment.