From c3d4d321d35e22ac50d74a9b5627c29b32579294 Mon Sep 17 00:00:00 2001 From: Lauritzen Kasper Primdal Date: Sat, 13 Jun 2020 14:44:23 +0200 Subject: [PATCH] Ensures weights/ dir exists Allows train.py to be run outside of yolov5/ directory. --- train.py | 1 + 1 file changed, 1 insertion(+) diff --git a/train.py b/train.py index 8748677fd5f1..dc7c301ad031 100644 --- a/train.py +++ b/train.py @@ -20,6 +20,7 @@ mixed_precision = False # not installed wdir = 'weights' + os.sep # weights dir +os.makedirs(wdir, exist_ok=True) last = wdir + 'last.pt' best = wdir + 'best.pt' results_file = 'results.txt'