This commit is contained in:
Glenn Jocher 2019-04-18 15:31:03 +02:00
parent 8fcfb6ac3a
commit 25bf9e3611
1 changed files with 6 additions and 5 deletions

View File

@ -93,11 +93,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)
y = [] # Plot lr schedule
for _ in range(epochs): # y = []
scheduler.step() # for _ in range(epochs):
y.append(optimizer.param_groups[0]['lr']) # scheduler.step()
plt.plot(y) # y.append(optimizer.param_groups[0]['lr'])
# 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)