updates
This commit is contained in:
parent
03dd0b82ea
commit
cf5bbc97ee
13
train.py
13
train.py
|
@ -23,6 +23,7 @@ hyp = {'k': 8.4875, # loss multiple
|
||||||
'weight_decay': 0.0005, # optimizer weight decay
|
'weight_decay': 0.0005, # optimizer weight decay
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def train(
|
def train(
|
||||||
cfg,
|
cfg,
|
||||||
data_cfg,
|
data_cfg,
|
||||||
|
@ -91,12 +92,12 @@ def train(
|
||||||
scheduler = optim.lr_scheduler.LambdaLR(optimizer, lr_lambda=lf, last_epoch=start_epoch - 1)
|
scheduler = optim.lr_scheduler.LambdaLR(optimizer, lr_lambda=lf, last_epoch=start_epoch - 1)
|
||||||
# scheduler = optim.lr_scheduler.MultiStepLR(optimizer, milestones=[218, 245], gamma=0.1, last_epoch=start_epoch - 1)
|
# scheduler = optim.lr_scheduler.MultiStepLR(optimizer, milestones=[218, 245], gamma=0.1, last_epoch=start_epoch - 1)
|
||||||
|
|
||||||
# Plot lr schedule
|
# # Plot lr schedule
|
||||||
y = []
|
# y = []
|
||||||
for _ in range(epochs):
|
# for _ in range(epochs):
|
||||||
scheduler.step()
|
# scheduler.step()
|
||||||
y.append(optimizer.param_groups[0]['lr'])
|
# y.append(optimizer.param_groups[0]['lr'])
|
||||||
plt.plot(y)
|
# plt.plot(y)
|
||||||
|
|
||||||
# Dataset
|
# Dataset
|
||||||
dataset = LoadImagesAndLabels(train_path, img_size=img_size, augment=True)
|
dataset = LoadImagesAndLabels(train_path, img_size=img_size, augment=True)
|
||||||
|
|
Loading…
Reference in New Issue