glenn-jocher
commited on
Commit
•
cbe39a1
1
Parent(s):
c654d18
Update utils.py
Browse files- utils/utils.py +4 -4
utils/utils.py
CHANGED
@@ -36,12 +36,12 @@ def init_seeds(seed=0):
|
|
36 |
np.random.seed(seed)
|
37 |
torch_utils.init_seeds(seed=seed)
|
38 |
|
|
|
39 |
def get_latest_run(search_dir = './runs'):
|
40 |
-
#
|
41 |
-
# assumes most recently saved 'last.pt' is the desired weights to --resume from
|
42 |
last_list = glob.glob(f'{search_dir}/**/last*.pt', recursive=True)
|
43 |
-
|
44 |
-
|
45 |
|
46 |
def check_git_status():
|
47 |
# Suggest 'git pull' if repo is out of date
|
|
|
36 |
np.random.seed(seed)
|
37 |
torch_utils.init_seeds(seed=seed)
|
38 |
|
39 |
+
|
40 |
def get_latest_run(search_dir = './runs'):
|
41 |
+
# Return path to most recent 'last.pt' in /runs (i.e. to --resume from)
|
|
|
42 |
last_list = glob.glob(f'{search_dir}/**/last*.pt', recursive=True)
|
43 |
+
return max(last_list, key = os.path.getctime)
|
44 |
+
|
45 |
|
46 |
def check_git_status():
|
47 |
# Suggest 'git pull' if repo is out of date
|