From 047b7e8e41ab6e190c486a016496dd098df42040 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 22 Jan 2022 18:35:11 +0100 Subject: [PATCH] Removed most of the new checks, leaving only the one after calling 'on_train_batch_end' --- train.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/train.py b/train.py index e1c4ffcdb352..510377e1178e 100644 --- a/train.py +++ b/train.py @@ -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 @@ -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): @@ -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)}")