Fix get_latest_run() to search inside 'weights' subfolders

This commit is contained in:
Alex Stoken committed 2020-06-17 10:26:55 -05:00
1 parent 5f2eeba233
commit d34291733b
1 file changed
+1 -1
+1 -1
View File
@@ -39,7 +39,7 @@ def init_seeds(seed=0):
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
last_list = glob.glob('runs/*/last.pt')
last_list = glob.glob('runs/*/weights/last.pt')
latest = max(last_list, key = os.path.getctime)
return latest