diff --git a/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_224x224_fps30.py b/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_224x224_fps30.py index 4c2e2b400f..a875f60dfb 100644 --- a/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_224x224_fps30.py +++ b/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_224x224_fps30.py @@ -17,7 +17,7 @@ total_epochs = 75 log_config = dict(interval=10) -custom_hooks_config = [dict(type='ModelSetEpochHook')] +custom_hooks = [dict(type='ModelSetEpochHook')] model = dict( type='GestureRecognizer', diff --git a/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_bbox_112x112_fps15.py b/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_bbox_112x112_fps15.py index ae2fe2e960..1125e55406 100644 --- a/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_bbox_112x112_fps15.py +++ b/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_bbox_112x112_fps15.py @@ -17,7 +17,7 @@ total_epochs = 130 log_config = dict(interval=10) -custom_hooks_config = [dict(type='ModelSetEpochHook')] +custom_hooks = [dict(type='ModelSetEpochHook')] model = dict( type='GestureRecognizer', diff --git a/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_bbox_112x112_fps15_rgb.py b/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_bbox_112x112_fps15_rgb.py index 9777dda67e..ac9fc89b7b 100644 --- a/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_bbox_112x112_fps15_rgb.py +++ b/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_bbox_112x112_fps15_rgb.py @@ -18,7 +18,7 @@ total_epochs = 130 log_config = dict(interval=10) -custom_hooks_config = [dict(type='ModelSetEpochHook')] +custom_hooks = [dict(type='ModelSetEpochHook')] model = dict( type='GestureRecognizer', diff --git a/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_bbox_224x224_fps30.py b/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_bbox_224x224_fps30.py index 8a00d1e9f4..1cbc1f5011 100644 --- a/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_bbox_224x224_fps30.py +++ b/configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture_bbox_224x224_fps30.py @@ -17,7 +17,7 @@ total_epochs = 75 log_config = dict(interval=10) -custom_hooks_config = [dict(type='ModelSetEpochHook')] +custom_hooks = [dict(type='ModelSetEpochHook')] model = dict( type='GestureRecognizer', diff --git a/mmpose/apis/train.py b/mmpose/apis/train.py index 1fbfb0edc8..9c30e32fee 100644 --- a/mmpose/apis/train.py +++ b/mmpose/apis/train.py @@ -168,6 +168,14 @@ def train_model(model, else: optimizer_config = cfg.optimizer_config + custom_hooks_cfg = cfg.get('custom_hooks', None) + if custom_hooks_cfg is None: + custom_hooks_cfg = cfg.get('custom_hooks_config', None) + if custom_hooks_cfg is not None: + warnings.warn( + '"custom_hooks_config" is deprecated, please use ' + '"custom_hooks" instead.', DeprecationWarning) + # register hooks runner.register_training_hooks( cfg.lr_config, @@ -175,7 +183,7 @@ def train_model(model, cfg.checkpoint_config, cfg.log_config, cfg.get('momentum_config', None), - custom_hooks_config=cfg.get('custom_hooks_config', None)) + custom_hooks_config=custom_hooks_cfg) if distributed: runner.register_hook(DistSamplerSeedHook())