Skip to content

Commit

Permalink
Make sure best.pt model file is preserved ClearML (#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
thepycoder and pre-commit-ci[bot] authored Sep 3, 2022
1 parent 15e82d2 commit 5cb9fe6
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 5cb9fe6

Please sign in to comment.