Skip to content

Commit

Permalink
move down nw
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowdolphin authored and glenn-jocher committed Jun 28, 2021
1 parent b7c489f commit dd5a574
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary
# Optimizer
nbs = 64 # nominal batch size
accumulate = max(int(round(nbs / batch_size)), 1) # accumulate loss before optimizing
nw = round(hyp['warmup_epochs'] * nb) # number of warmup iterations
do_step = get_step_condition(nw, accumulate)
hyp['weight_decay'] *= batch_size * accumulate / nbs # scale weight_decay
logger.info(f"Scaled weight_decay = {hyp['weight_decay']}")

Expand Down Expand Up @@ -294,6 +292,8 @@ def train(hyp, # path/to/hyp.yaml or hyp dictionary

# Start training
t0 = time.time()
nw = round(hyp['warmup_epochs'] * nb) # number of warmup iterations
do_step = get_step_condition(nw, accumulate)
maps = np.zeros(nc) # mAP per class
results = (0, 0, 0, 0, 0, 0, 0) # P, R, mAP@.5, mAP@.5-.95, val_loss(box, obj, cls)
scheduler.last_epoch = start_epoch - 1 # do not move
Expand Down

0 comments on commit dd5a574

Please sign in to comment.