updates
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
976eea04bd
commit
6cd98c46d8
8
train.py
8
train.py
|
@ -66,6 +66,10 @@ def train():
|
||||||
train_path = data_dict['train']
|
train_path = data_dict['train']
|
||||||
nc = int(data_dict['classes']) # number of classes
|
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
|
# Initialize model
|
||||||
model = Darknet(cfg, arc=opt.arc).to(device)
|
model = Darknet(cfg, arc=opt.arc).to(device)
|
||||||
|
|
||||||
|
@ -183,10 +187,6 @@ def train():
|
||||||
pin_memory=True,
|
pin_memory=True,
|
||||||
collate_fn=dataset.collate_fn)
|
collate_fn=dataset.collate_fn)
|
||||||
|
|
||||||
# Remove previous results
|
|
||||||
for f in glob.glob('*_batch*.jpg') + glob.glob('results.txt'):
|
|
||||||
os.remove(f)
|
|
||||||
|
|
||||||
# Start training
|
# Start training
|
||||||
model.nc = nc # attach number of classes to model
|
model.nc = nc # attach number of classes to model
|
||||||
model.arc = opt.arc # attach yolo architecture
|
model.arc = opt.arc # attach yolo architecture
|
||||||
|
|
Loading…
Reference in New Issue