Skip to content

Commit

Permalink
fix: use epochs instead of max_epochs
Browse files Browse the repository at this point in the history
  • Loading branch information
Unbinilium committed Jul 7, 2023
1 parent cc80e1a commit a74fe8c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions configs/yolov5/base_arch.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# -----train val related-----
# Base learning rate for optim_wrapper. Corresponding to 8xb16=128 bs
base_lr = 0.01
max_epochs = 300 # Maximum training epochs
epochs = 300 # Maximum training epochs

model_test_cfg = dict(
# The config of multi-label for multi-class prediction.
Expand Down Expand Up @@ -239,7 +239,7 @@

default_hooks = dict(
param_scheduler=dict(
type='YOLOv5ParamSchedulerHook', scheduler_type='linear', lr_factor=lr_factor, max_epochs=max_epochs
type='YOLOv5ParamSchedulerHook', scheduler_type='linear', lr_factor=lr_factor, max_epochs=epochs
),
checkpoint=dict(
type='CheckpointHook', interval=save_checkpoint_intervals, save_best='auto', max_keep_ckpts=max_keep_ckpts
Expand All @@ -258,7 +258,7 @@
test_evaluator = val_evaluator

train_cfg = dict(
type='EpochBasedTrainLoop', max_epochs=max_epochs, val_interval=save_checkpoint_intervals, _delete_=True
type='EpochBasedTrainLoop', max_epochs=epochs, val_interval=save_checkpoint_intervals, _delete_=True
)
val_cfg = dict(type='ValLoop')
test_cfg = dict(type='TestLoop')
6 changes: 3 additions & 3 deletions configs/yolox/base_arch.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# -----train val related-----
# Base learning rate for optim_wrapper. Corresponding to 8xb16=128 bs
base_lr = 0.01
max_epochs = 300 # Maximum training epochs
epochs = 300 # Maximum training epochs

model_test_cfg = dict(
# The config of multi-label for multi-class prediction.
Expand Down Expand Up @@ -292,7 +292,7 @@
type="YOLOv5ParamSchedulerHook",
scheduler_type="linear",
lr_factor=lr_factor,
max_epochs=max_epochs,
max_epochs=epochs,
),
checkpoint=dict(
type="CheckpointHook",
Expand Down Expand Up @@ -323,7 +323,7 @@

train_cfg = dict(
type="EpochBasedTrainLoop",
max_epochs=max_epochs,
max_epochs=epochs,
val_interval=save_checkpoint_intervals,
_delete_=True,
)
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/training/fomo.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ optim_wrapper=dict(optimizer=dict(type='Adam', lr=lr, weight_decay=5e-4,eps=1e-7
#evaluator
val_evaluator=dict(type='FomoMetric')
test_evaluator=val_evaluator
train_cfg=dict(by_epoch=True,max_epochs=70)
train_cfg=dict(by_epoch=True, max_epochs=70)

# learning policy
param_scheduler=[
Expand Down

0 comments on commit a74fe8c

Please sign in to comment.