Skip to content

Commit

Permalink
Flush callbacks when on --evolve (ultralytics#6374)
Browse files Browse the repository at this point in the history
* log best.pt metrics at train end

* update

* Update __init__.py

* flush callbacks when using evolve

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
  • Loading branch information
AyushExel and glenn-jocher committed Jan 20, 2022
1 parent 42ccb47 commit eac4f7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def main(opt, callbacks=Callbacks()):

# Train mutation
results = train(hyp.copy(), opt, device, callbacks)

callbacks = Callbacks()
# Write mutation results
print_mutation(results, hyp.copy(), save_dir, opt.bucket)

Expand Down
5 changes: 1 addition & 4 deletions utils/loggers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,7 @@ def on_train_end(self, last, best, plots, epoch, results):
wandb.log_artifact(str(best if best.exists() else last), type='model',
name='run_' + self.wandb.wandb_run.id + '_model',
aliases=['latest', 'best', 'stripped'])
self.wandb.finish_run()
else:
self.wandb.finish_run()
self.wandb = WandbLogger(self.opt)
self.wandb.finish_run()

def on_params_update(self, params):
# Update hyperparams or configs of the experiment
Expand Down

0 comments on commit eac4f7f

Please sign in to comment.