diff --git a/train.py b/train.py index ace1e41e..a657d378 100644 --- a/train.py +++ b/train.py @@ -66,6 +66,10 @@ def train(): train_path = data_dict['train'] nc = int(data_dict['classes']) # number of classes + # Remove previous results + for f in glob.glob('*_batch*.jpg') + glob.glob('results.txt'): + os.remove(f) + # Initialize model model = Darknet(cfg, arc=opt.arc).to(device) @@ -183,10 +187,6 @@ def train(): pin_memory=True, collate_fn=dataset.collate_fn) - # Remove previous results - for f in glob.glob('*_batch*.jpg') + glob.glob('results.txt'): - os.remove(f) - # Start training model.nc = nc # attach number of classes to model model.arc = opt.arc # attach yolo architecture