Lauritzen Kasper Primdal commited on
Commit
c3d4d32
1 Parent(s): 099e6f5

Ensures weights/ dir exists

Browse files

Allows train.py to be run outside of yolov5/ directory.

Files changed (1) hide show
  1. train.py +1 -0
train.py CHANGED
@@ -20,6 +20,7 @@ except:
20
  mixed_precision = False # not installed
21
 
22
  wdir = 'weights' + os.sep # weights dir
 
23
  last = wdir + 'last.pt'
24
  best = wdir + 'best.pt'
25
  results_file = 'results.txt'
 
20
  mixed_precision = False # not installed
21
 
22
  wdir = 'weights' + os.sep # weights dir
23
+ os.makedirs(wdir, exist_ok=True)
24
  last = wdir + 'last.pt'
25
  best = wdir + 'best.pt'
26
  results_file = 'results.txt'