From a74fe8c0318571605cb9973ba97edfd821bdccd3 Mon Sep 17 00:00:00 2001 From: Unbinilium <15633984+Unbinilium@users.noreply.github.com> Date: Fri, 7 Jul 2023 23:46:34 +0800 Subject: [PATCH] fix: use epochs instead of max_epochs --- configs/yolov5/base_arch.py | 6 +++--- configs/yolox/base_arch.py | 6 +++--- docs/tutorials/training/fomo.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/configs/yolov5/base_arch.py b/configs/yolov5/base_arch.py index ffa53167..ec979a3b 100644 --- a/configs/yolov5/base_arch.py +++ b/configs/yolov5/base_arch.py @@ -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. @@ -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 @@ -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') diff --git a/configs/yolox/base_arch.py b/configs/yolox/base_arch.py index 7a39436d..f8af088f 100644 --- a/configs/yolox/base_arch.py +++ b/configs/yolox/base_arch.py @@ -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. @@ -292,7 +292,7 @@ type="YOLOv5ParamSchedulerHook", scheduler_type="linear", lr_factor=lr_factor, - max_epochs=max_epochs, + max_epochs=epochs, ), checkpoint=dict( type="CheckpointHook", @@ -323,7 +323,7 @@ train_cfg = dict( type="EpochBasedTrainLoop", - max_epochs=max_epochs, + max_epochs=epochs, val_interval=save_checkpoint_intervals, _delete_=True, ) diff --git a/docs/tutorials/training/fomo.md b/docs/tutorials/training/fomo.md index 0f54dfbf..b7e3e977 100644 --- a/docs/tutorials/training/fomo.md +++ b/docs/tutorials/training/fomo.md @@ -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=[