Ayush Chaurasia glenn-jocher commited on
Commit
9bcc32a
1 Parent(s): e1893c8

Flush callbacks when on `--evolve` (#6374)

Browse files

* log best.pt metrics at train end

* update

* Update __init__.py

* flush callbacks when using evolve

Co-authored-by: Glenn Jocher <[email protected]>

Files changed (2) hide show
  1. train.py +1 -1
  2. utils/loggers/__init__.py +1 -4
train.py CHANGED
@@ -612,7 +612,7 @@ def main(opt, callbacks=Callbacks()):
612
 
613
  # Train mutation
614
  results = train(hyp.copy(), opt, device, callbacks)
615
-
616
  # Write mutation results
617
  print_mutation(results, hyp.copy(), save_dir, opt.bucket)
618
 
 
612
 
613
  # Train mutation
614
  results = train(hyp.copy(), opt, device, callbacks)
615
+ callbacks = Callbacks()
616
  # Write mutation results
617
  print_mutation(results, hyp.copy(), save_dir, opt.bucket)
618
 
utils/loggers/__init__.py CHANGED
@@ -159,10 +159,7 @@ class Loggers():
159
  wandb.log_artifact(str(best if best.exists() else last), type='model',
160
  name='run_' + self.wandb.wandb_run.id + '_model',
161
  aliases=['latest', 'best', 'stripped'])
162
- self.wandb.finish_run()
163
- else:
164
- self.wandb.finish_run()
165
- self.wandb = WandbLogger(self.opt)
166
 
167
  def on_params_update(self, params):
168
  # Update hyperparams or configs of the experiment
 
159
  wandb.log_artifact(str(best if best.exists() else last), type='model',
160
  name='run_' + self.wandb.wandb_run.id + '_model',
161
  aliases=['latest', 'best', 'stripped'])
162
+ self.wandb.finish_run()
 
 
 
163
 
164
  def on_params_update(self, params):
165
  # Update hyperparams or configs of the experiment