Skip to content

Commit

Permalink
Merge pull request #357 from yuedongli1/master
Browse files Browse the repository at this point in the history
add scale for loss hyps
  • Loading branch information
CaitinZhao authored Sep 20, 2024
2 parents 1868066 + c36e09d commit 3834320
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ def train(args):
else:
eval_dataset, eval_dataloader = None, None

# Scale loss hyps
args.loss.cls *= args.data.nc / 80
args.loss.obj *= (args.img_size / 640) ** 2

# Create Loss
loss_fn = create_loss(
**args.loss, anchors=args.network.get("anchors", 1), stride=args.network.stride, nc=args.data.nc
Expand Down

0 comments on commit 3834320

Please sign in to comment.