Browse Source

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

* 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>
modifyDataloader
Ayush Chaurasia GitHub 2 years ago
parent
commit
9bcc32a5bf
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions
  1. +1
    -1
      train.py
  2. +1
    -4
      utils/loggers/__init__.py

+ 1
- 1
train.py View File



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



+ 1
- 4
utils/loggers/__init__.py View File

wandb.log_artifact(str(best if best.exists() else last), type='model', wandb.log_artifact(str(best if best.exists() else last), type='model',
name='run_' + self.wandb.wandb_run.id + '_model', name='run_' + self.wandb.wandb_run.id + '_model',
aliases=['latest', 'best', 'stripped']) 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): def on_params_update(self, params):
# Update hyperparams or configs of the experiment # Update hyperparams or configs of the experiment

Loading…
Cancel
Save