updates
This commit is contained in:
parent
bb3682024e
commit
02291622fa
12
train.py
12
train.py
|
@ -12,11 +12,13 @@ from utils.datasets import *
|
||||||
from utils.utils import *
|
from utils.utils import *
|
||||||
|
|
||||||
# Hyperparameters: train.py --evolve --epochs 2 --img-size 320, Metrics: 0.204 0.302 0.175 0.234 (square smart)
|
# Hyperparameters: train.py --evolve --epochs 2 --img-size 320, Metrics: 0.204 0.302 0.175 0.234 (square smart)
|
||||||
hyp = {'xy': 0.1, # xy loss gain (giou is about 0.02)
|
hyp = {'giou': .035, # giou loss gain
|
||||||
'wh': 0.1, # wh loss gain
|
'xy': 0.20, # xy loss gain
|
||||||
'cls': 0.04, # cls loss gain
|
'wh': 0.10, # wh loss gain
|
||||||
'conf': 4.5, # conf loss gain
|
'cls': 0.035, # cls loss gain
|
||||||
'iou_t': 0.5, # iou target-anchor training threshold
|
'conf': 1.61, # conf loss gain
|
||||||
|
'conf_bpw': 3.53, # conf BCELoss positive_weight
|
||||||
|
'iou_t': 0.29, # iou target-anchor training threshold
|
||||||
'lr0': 0.001, # initial learning rate
|
'lr0': 0.001, # initial learning rate
|
||||||
'lrf': -4., # final learning rate = lr0 * (10 ** lrf)
|
'lrf': -4., # final learning rate = lr0 * (10 ** lrf)
|
||||||
'momentum': 0.90, # SGD momentum
|
'momentum': 0.90, # SGD momentum
|
||||||
|
|
|
@ -279,7 +279,7 @@ def compute_loss(p, targets, model): # predictions, targets, model
|
||||||
# Define criteria
|
# Define criteria
|
||||||
MSE = nn.MSELoss()
|
MSE = nn.MSELoss()
|
||||||
CE = nn.CrossEntropyLoss() # (weight=model.class_weights)
|
CE = nn.CrossEntropyLoss() # (weight=model.class_weights)
|
||||||
BCE = nn.BCEWithLogitsLoss()
|
BCE = nn.BCEWithLogitsLoss(pos_weight=ft([h['conf_bpw']]))
|
||||||
|
|
||||||
# Compute losses
|
# Compute losses
|
||||||
bs = p[0].shape[0] # batch size
|
bs = p[0].shape[0] # batch size
|
||||||
|
|
Loading…
Reference in New Issue