Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'CosineAnealingLrUpdaterHook is not in the hook registry' #167

Closed
XavierCHEN34 opened this issue Dec 1, 2020 · 3 comments
Closed

Comments

@XavierCHEN34
Copy link

XavierCHEN34 commented Dec 1, 2020

KeyError: 'CosineAnealingLrUpdaterHook is not in the hook registry'

Traceback (most recent call last):
File "./tools/train.py", line 145, in
main()
File "./tools/train.py", line 141, in main
meta=meta)
File "/home/xx/data/workspace/matting/mmediting/mmedit/apis/train.py", line 69, in train_model
meta=meta)
File "/home/xx/data/workspace/matting/mmediting/mmedit/apis/train.py", line 148, in _dist_train
log_config=cfg.log_config)
File "/home/xx/anaconda3/lib/python3.7/site-packages/mmcv/runner/iter_based_runner.py", line 238, in register_training_hooks
self.register_lr_hook(lr_config)
File "/home/xx/anaconda3/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 360, in register_lr_hook
hook = mmcv.build_from_cfg(lr_config, HOOKS)
File "/home/xx/anaconda3/lib/python3.7/site-packages/mmcv/utils/registry.py", line 164, in build_from_cfg
f'{obj_type} is not in the {registry.name} registry')
KeyError: 'CosineAnealingLrUpdaterHook is not in the hook registry'
Traceback (most recent call last):
File "./tools/train.py", line 145, in
main()
File "./tools/train.py", line 141, in main
meta=meta)
File "/home/xx/data/workspace/matting/mmediting/mmedit/apis/train.py", line 69, in train_model
meta=meta)
File "/home/xx/data/workspace/matting/mmediting/mmedit/apis/train.py", line 148, in _dist_train
log_config=cfg.log_config)
File "/home/xx/anaconda3/lib/python3.7/site-packages/mmcv/runner/iter_based_runner.py", line 238, in register_training_hooks
Traceback (most recent call last):
File "./tools/train.py", line 145, in
self.register_lr_hook(lr_config)
File "/home/xx/anaconda3/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 360, in register_lr_hook
main()
File "./tools/train.py", line 141, in main
hook = mmcv.build_from_cfg(lr_config, HOOKS)
File "/home/xx/anaconda3/lib/python3.7/site-packages/mmcv/utils/registry.py", line 164, in build_from_cfg
meta=meta)
File "/home/xx/data/workspace/matting/mmediting/mmedit/apis/train.py", line 69, in train_model
f'{obj_type} is not in the {registry.name} registry')meta=meta)

File "/home/xx/data/workspace/matting/mmediting/mmedit/apis/train.py", line 148, in _dist_train
KeyError: 'CosineAnealingLrUpdaterHook is not in the hook registry'
log_config=cfg.log_config)
File "/home/xx/anaconda3/lib/python3.7/site-packages/mmcv/runner/iter_based_runner.py", line 238, in register_training_hooks
self.register_lr_hook(lr_config)
File "/home/xx/anaconda3/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 360, in register_lr_hook
Traceback (most recent call last):
File "./tools/train.py", line 145, in
hook = mmcv.build_from_cfg(lr_config, HOOKS)
File "/home/xx/anaconda3/lib/python3.7/site-packages/mmcv/utils/registry.py", line 164, in build_from_cfg
main()
File "./tools/train.py", line 141, in main
f'{obj_type} is not in the {registry.name} registry')
KeyError: 'CosineAnealingLrUpdaterHook is not in the hook registry'
meta=meta)
File "/home/xx/data/workspace/matting/mmediting/mmedit/apis/train.py", line 69, in train_model
meta=meta)
File "/home/xx/data/workspace/matting/mmediting/mmedit/apis/train.py", line 148, in _dist_train
log_config=cfg.log_config)
File "/home/xx/anaconda3/lib/python3.7/site-packages/mmcv/runner/iter_based_runner.py", line 238, in register_training_hooks
self.register_lr_hook(lr_config)
File "/home/xx/anaconda3/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 360, in register_lr_hook
hook = mmcv.build_from_cfg(lr_config, HOOKS)
File "/home/xx/anaconda3/lib/python3.7/site-packages/mmcv/utils/registry.py", line 164, in build_from_cfg
f'{obj_type} is not in the {registry.name} registry')
KeyError: 'CosineAnealingLrUpdaterHook is not in the hook registry'
Traceback (most recent call last):
File "/home/xx/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/xx/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/xx/anaconda3/lib/python3.7/site-packages/torch/distributed/launch.py", line 260, in
main()
File "/home/xx/anaconda3/lib/python3.7/site-packages/torch/distributed/launch.py", line 256, in main
cmd=cmd)
subprocess.CalledProcessError: Command '['/home/xx/anaconda3/bin/python', '-u', './tools/train.py', '--local_rank=3', './configs/mattors/gca/gca_r34_4x10_200k_comp1k.py', '--launcher', 'pytorch']' returned non-zero exit status 1.

When running
CUDA_VISIBLE_DEVICES=4,5,6,7 PORT=29501 ./tools/dist_train.sh ./configs/mattors/gca/gca_r34_4x10_200k_comp1k.py 4

@XavierCHEN34
Copy link
Author

XavierCHEN34 commented Dec 2, 2020

I find that
policy='CosineAnealing
should be changed to
policy='CosineAnnealing
to match mmcv-full==1.2.1

@nbei
Copy link
Collaborator

nbei commented Dec 2, 2020

Thanks @XavierCHEN34. I wil fix this bug later.

@nbei
Copy link
Collaborator

nbei commented Jan 25, 2021

Fixed in #185

@nbei nbei closed this as completed Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants