From 663cfc80772ba194b23d94711facdba61adf40dc Mon Sep 17 00:00:00 2001 From: blkcat Date: Mon, 14 Mar 2022 18:03:51 +0800 Subject: [PATCH] [Fix] complete training hooks. (#1236) * Fix: complete training hooks. * not expose timer_hook Co-authored-by: ly015 --- mmpose/apis/train.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mmpose/apis/train.py b/mmpose/apis/train.py index 2fd17713b2..1fbfb0edc8 100644 --- a/mmpose/apis/train.py +++ b/mmpose/apis/train.py @@ -169,9 +169,14 @@ def train_model(model, optimizer_config = cfg.optimizer_config # register hooks - runner.register_training_hooks(cfg.lr_config, optimizer_config, - cfg.checkpoint_config, cfg.log_config, - cfg.get('momentum_config', None)) + runner.register_training_hooks( + cfg.lr_config, + optimizer_config, + cfg.checkpoint_config, + cfg.log_config, + cfg.get('momentum_config', None), + custom_hooks_config=cfg.get('custom_hooks_config', None)) + if distributed: runner.register_hook(DistSamplerSeedHook())