glenn-jocher commited on
Commit
120d40c
1 Parent(s): 38acc5f

Update train.py

Browse files

This updates the PR to a one-liner to minimize additions. Perhaps we can include opt in the future but let's start with this for now.

Files changed (1) hide show
  1. train.py +1 -8
train.py CHANGED
@@ -58,14 +58,6 @@ def train(hyp):
58
  with open(Path(log_dir) / 'opt.yaml', 'w') as f:
59
  yaml.dump(vars(opt), f, sort_keys=False)
60
 
61
- # Log hyperparameters in tensorboard
62
- if tb_writer:
63
- tb_hparams_dict = hyp
64
- tb_hparams_dict.update(vars(opt))
65
- tb_hparams_dict['img_size_train'], tb_hparams_dict['img_size_test'] = tb_hparams_dict['img_size']
66
- del tb_hparams_dict['img_size']
67
- tb_writer.add_hparams(tb_hparams_dict, {})
68
-
69
  epochs = opt.epochs # 300
70
  batch_size = opt.batch_size # 64
71
  weights = opt.weights # initial training weights
@@ -194,6 +186,7 @@ def train(hyp):
194
  # model._initialize_biases(cf.to(device))
195
  plot_labels(labels, save_dir=log_dir)
196
  if tb_writer:
 
197
  tb_writer.add_histogram('classes', c, 0)
198
 
199
  # Check anchors
 
58
  with open(Path(log_dir) / 'opt.yaml', 'w') as f:
59
  yaml.dump(vars(opt), f, sort_keys=False)
60
 
 
 
 
 
 
 
 
 
61
  epochs = opt.epochs # 300
62
  batch_size = opt.batch_size # 64
63
  weights = opt.weights # initial training weights
 
186
  # model._initialize_biases(cf.to(device))
187
  plot_labels(labels, save_dir=log_dir)
188
  if tb_writer:
189
+ tb_writer.add_hparams(hyp, {})
190
  tb_writer.add_histogram('classes', c, 0)
191
 
192
  # Check anchors