From f573250ae832a24d4f5a68b4ec76df388a0789e6 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 16 Jun 2019 23:17:40 +0200 Subject: [PATCH] updates --- train.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/train.py b/train.py index 174d9763..10f9e578 100644 --- a/train.py +++ b/train.py @@ -122,6 +122,10 @@ def train( else: cutoff = load_darknet_weights(model, weights + 'darknet53.conv.74') + # Remove old results + for f in glob.glob('*_batch*.jpg') + glob.glob('results.txt'): + os.remove(f) + # Scheduler https://github.com/ultralytics/yolov3/issues/238 # lf = lambda x: 1 - x / epochs # linear ramp to zero # lf = lambda x: 10 ** (hyp['lrf'] * x / epochs) # exp ramp @@ -170,10 +174,6 @@ def train( from apex import amp model, optimizer = amp.initialize(model, optimizer, opt_level='O1') - # Remove old results - for f in glob.glob('*_batch*.jpg') + glob.glob('results.txt'): - os.remove(f) - # Start training model.hyp = hyp # attach hyperparameters to model model.class_weights = labels_to_class_weights(dataset.labels, nc).to(device) # attach class weights