updates
This commit is contained in:
parent
b59532883a
commit
f573250ae8
8
train.py
8
train.py
|
@ -122,6 +122,10 @@ def train(
|
||||||
else:
|
else:
|
||||||
cutoff = load_darknet_weights(model, weights + 'darknet53.conv.74')
|
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
|
# Scheduler https://github.com/ultralytics/yolov3/issues/238
|
||||||
# lf = lambda x: 1 - x / epochs # linear ramp to zero
|
# lf = lambda x: 1 - x / epochs # linear ramp to zero
|
||||||
# lf = lambda x: 10 ** (hyp['lrf'] * x / epochs) # exp ramp
|
# lf = lambda x: 10 ** (hyp['lrf'] * x / epochs) # exp ramp
|
||||||
|
@ -170,10 +174,6 @@ def train(
|
||||||
from apex import amp
|
from apex import amp
|
||||||
model, optimizer = amp.initialize(model, optimizer, opt_level='O1')
|
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
|
# Start training
|
||||||
model.hyp = hyp # attach hyperparameters to model
|
model.hyp = hyp # attach hyperparameters to model
|
||||||
model.class_weights = labels_to_class_weights(dataset.labels, nc).to(device) # attach class weights
|
model.class_weights = labels_to_class_weights(dataset.labels, nc).to(device) # attach class weights
|
||||||
|
|
Loading…
Reference in New Issue