Skip to content

Commit

Permalink
Removed most of the new checks, leaving only the one after calling 'o…
Browse files Browse the repository at this point in the history
…n_train_batch_end'
  • Loading branch information
haimat authored and glenn-jocher committed Jan 23, 2022
1 parent abb4643 commit 047b7e8
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,6 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
best_fitness = fi
log_vals = list(mloss) + list(results) + lr
callbacks.run('on_fit_epoch_end', log_vals, epoch, best_fitness, fi)
if callbacks.stop_training:
return

# Save model
if (not nosave) or (final_epoch and not evolve): # if save
Expand All @@ -405,8 +403,6 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
torch.save(ckpt, w / f'epoch{epoch}.pt')
del ckpt
callbacks.run('on_model_save', last, epoch, final_epoch, best_fitness, fi)
if callbacks.stop_training:
return

# Stop Single-GPU
if RANK == -1 and stopper(epoch=epoch, fitness=fi):
Expand Down Expand Up @@ -446,8 +442,6 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
compute_loss=compute_loss) # val best model with plots
if is_coco:
callbacks.run('on_fit_epoch_end', list(mloss) + list(results) + lr, epoch, best_fitness, fi)
if callbacks.stop_training:
return

callbacks.run('on_train_end', last, best, plots, epoch, results)
LOGGER.info(f"Results saved to {colorstr('bold', save_dir)}")
Expand Down

0 comments on commit 047b7e8

Please sign in to comment.