astoken commited on
Commit
4418809
1 Parent(s): d9f446c

change weights dir (wdir) to be unique to each run, under log_dir

Browse files
Files changed (1) hide show
  1. train.py +11 -8
train.py CHANGED
@@ -18,11 +18,6 @@ except:
18
  print('Apex recommended for faster mixed precision training: https://github.com/NVIDIA/apex')
19
  mixed_precision = False # not installed
20
 
21
- wdir = 'weights' + os.sep # weights dir
22
- os.makedirs(wdir, exist_ok=True)
23
- last = wdir + 'last.pt'
24
- best = wdir + 'best.pt'
25
- results_file = 'results.txt'
26
 
27
  # Hyperparameters
28
  hyp = {'lr0': 0.01, # initial learning rate (SGD=1E-2, Adam=1E-3)
@@ -59,13 +54,21 @@ if hyp['fl_gamma']:
59
 
60
 
61
  def train(hyp):
 
 
 
 
 
 
 
 
 
 
 
62
  epochs = opt.epochs # 300
63
  batch_size = opt.batch_size # 64
64
  weights = opt.weights # initial training weights
65
 
66
- #write all results to the tb log_dir, so all data from one run is together
67
- log_dir = tb_writer.log_dir
68
-
69
  # Configure
70
  init_seeds(1)
71
  with open(opt.data) as f:
 
18
  print('Apex recommended for faster mixed precision training: https://github.com/NVIDIA/apex')
19
  mixed_precision = False # not installed
20
 
 
 
 
 
 
21
 
22
  # Hyperparameters
23
  hyp = {'lr0': 0.01, # initial learning rate (SGD=1E-2, Adam=1E-3)
 
54
 
55
 
56
  def train(hyp):
57
+ #write all results to the tb log_dir, so all data from one run is together
58
+ log_dir = tb_writer.log_dir
59
+
60
+ #weights dir unique to each experiment
61
+ wdir = os.path.join(log_dir, 'weights') + os.sep # weights dir
62
+
63
+ os.makedirs(wdir, exist_ok=True)
64
+ last = wdir + 'last.pt'
65
+ best = wdir + 'best.pt'
66
+ results_file = 'results.txt'
67
+
68
  epochs = opt.epochs # 300
69
  batch_size = opt.batch_size # 64
70
  weights = opt.weights # initial training weights
71
 
 
 
 
72
  # Configure
73
  init_seeds(1)
74
  with open(opt.data) as f: