Unverified Commit f482dd78 authored by Yezhen Cong's avatar Yezhen Cong Committed by GitHub
Browse files

[Refactor] Customize runner type (#437)

parent e37f5d5e
...@@ -12,7 +12,7 @@ The required versions of MMCV and MMDetection for different versions of MMDetect ...@@ -12,7 +12,7 @@ The required versions of MMCV and MMDetection for different versions of MMDetect
| MMDetection3D version | MMDetection version | MMCV version | | MMDetection3D version | MMDetection version | MMCV version |
|:-------------------:|:-------------------:|:-------------------:| |:-------------------:|:-------------------:|:-------------------:|
| master | mmdet>=2.5.0 | mmcv-full>=1.2.4, <=1.4| | master | mmdet>=2.10.0 | mmcv-full>=1.2.4, <=1.4|
| 0.12.0 | mmdet>=2.5.0 | mmcv-full>=1.2.4, <=1.4| | 0.12.0 | mmdet>=2.5.0 | mmcv-full>=1.2.4, <=1.4|
| 0.11.0 | mmdet>=2.5.0 | mmcv-full>=1.2.4, <=1.4| | 0.11.0 | mmdet>=2.5.0 | mmcv-full>=1.2.4, <=1.4|
| 0.10.0 | mmdet>=2.5.0 | mmcv-full>=1.2.4, <=1.4| | 0.10.0 | mmdet>=2.5.0 | mmcv-full>=1.2.4, <=1.4|
......
...@@ -365,14 +365,14 @@ log_config = dict( # config to register logger hook ...@@ -365,14 +365,14 @@ log_config = dict( # config to register logger hook
interval=50, # Interval to print the log interval=50, # Interval to print the log
hooks=[dict(type='TextLoggerHook'), hooks=[dict(type='TextLoggerHook'),
dict(type='TensorboardLoggerHook')]) # The logger used to record the training process. dict(type='TensorboardLoggerHook')]) # The logger used to record the training process.
total_epochs = 36 # Total epochs to train the model runner = dict(type='EpochBasedRunner', max_epochs=36) # Runner that runs the workflow in total max_epochs
dist_params = dict(backend='nccl') # Parameters to setup distributed training, the port can also be set. dist_params = dict(backend='nccl') # Parameters to setup distributed training, the port can also be set.
log_level = 'INFO' # The level of logging. log_level = 'INFO' # The level of logging.
find_unused_parameters = True # Whether to find unused parameters find_unused_parameters = True # Whether to find unused parameters
work_dir = None # Directory to save the model checkpoints and logs for the current experiments. work_dir = None # Directory to save the model checkpoints and logs for the current experiments.
load_from = None # load models as a pre-trained model from a given path. This will not resume training. load_from = None # load models as a pre-trained model from a given path. This will not resume training.
resume_from = None # Resume checkpoints from a given path, the training will be resumed from the epoch when the checkpoint's is saved. resume_from = None # Resume checkpoints from a given path, the training will be resumed from the epoch when the checkpoint's is saved.
workflow = [('train', 1)] # Workflow for runner. [('train', 1)] means there is only one workflow and the workflow named 'train' is executed once. The workflow trains the model by 36 epochs according to the total_epochs. workflow = [('train', 1)] # Workflow for runner. [('train', 1)] means there is only one workflow and the workflow named 'train' is executed once. The workflow trains the model by 36 epochs according to the max_epochs.
gpu_ids = range(0, 1) # ids of gpus gpu_ids = range(0, 1) # ids of gpus
``` ```
......
...@@ -179,7 +179,7 @@ so that 1 epoch for training and 1 epoch for validation will be run iteratively. ...@@ -179,7 +179,7 @@ so that 1 epoch for training and 1 epoch for validation will be run iteratively.
**Note**: **Note**:
1. The parameters of model will not be updated during val epoch. 1. The parameters of model will not be updated during val epoch.
2. Keyword `total_epochs` in the config only controls the number of training epochs and will not affect the validation workflow. 2. Keyword `max_epochs` in `runner` in the config only controls the number of training epochs and will not affect the validation workflow.
3. Workflows `[('train', 1), ('val', 1)]` and `[('train', 1)]` will not change the behavior of `EvalHook` because `EvalHook` is called by `after_train_epoch` and validation workflow only affect hooks that are called through `after_val_epoch`. Therefore, the only difference between `[('train', 1), ('val', 1)]` and `[('train', 1)]` is that the runner will calculate losses on validation set after each training epoch. 3. Workflows `[('train', 1), ('val', 1)]` and `[('train', 1)]` will not change the behavior of `EvalHook` because `EvalHook` is called by `after_train_epoch` and validation workflow only affect hooks that are called through `after_val_epoch`. Therefore, the only difference between `[('train', 1), ('val', 1)]` and `[('train', 1)]` is that the runner will calculate losses on validation set after each training epoch.
## Customize hooks ## Customize hooks
......
...@@ -26,7 +26,7 @@ assert (mmcv_version >= digit_version(mmcv_minimum_version) ...@@ -26,7 +26,7 @@ assert (mmcv_version >= digit_version(mmcv_minimum_version)
f'MMCV=={mmcv.__version__} is used but incompatible. ' \ f'MMCV=={mmcv.__version__} is used but incompatible. ' \
f'Please install mmcv>={mmcv_minimum_version}, <={mmcv_maximum_version}.' f'Please install mmcv>={mmcv_minimum_version}, <={mmcv_maximum_version}.'
mmdet_minimum_version = '2.5.0' mmdet_minimum_version = '2.10.0'
mmdet_maximum_version = '3.0.0' mmdet_maximum_version = '3.0.0'
mmdet_version = digit_version(mmdet.__version__) mmdet_version = digit_version(mmdet.__version__)
assert (mmdet_version >= digit_version(mmdet_minimum_version) assert (mmdet_version >= digit_version(mmdet_minimum_version)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment