Skip to content

Commit

Permalink
Make sure best.pt model file is preserved ClearML (ultralytics#9265)
Browse files Browse the repository at this point in the history
* Make sure best.pt model file is preserved ClearML

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and Clay Januhowski committed Sep 8, 2022
1 parent b14bdfe commit 65bc4ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/loggers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ def on_train_end(self, last, best, epoch, results):
self.wandb.finish_run()

if self.clearml and not self.opt.evolve:
self.clearml.task.update_output_model(model_path=str(best if best.exists() else last), name='Best Model')
self.clearml.task.update_output_model(model_path=str(best if best.exists() else last),
name='Best Model',
auto_delete_file=False)

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

0 comments on commit 65bc4ba

Please sign in to comment.