This commit is contained in:
Glenn Jocher 2019-06-16 23:17:40 +02:00
parent b59532883a
commit f573250ae8
1 changed files with 4 additions and 4 deletions

View File

@ -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