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

fp16 setting #159

Open
hbl843449791 opened this issue Aug 11, 2024 · 3 comments
Open

fp16 setting #159

hbl843449791 opened this issue Aug 11, 2024 · 3 comments

Comments

@hbl843449791
Copy link

Traceback (most recent call last):
File "tools/train.py", line 245, in
main()
File "tools/train.py", line 241, in main
meta=meta)
File "/mnt/data/Co-DETR/tools/mmdet/apis/train.py", line 187, in train_detector
elif distributed and 'type' not in cfg.optimizer_config:
File "/mnt/data/miniconda/envs/co-detr/lib/python3.7/site-packages/mmcv/utils/config.py", line 513, in getattr
return getattr(self._cfg_dict, name)
File "/mnt/data/miniconda/envs/co-detr/lib/python3.7/site-packages/mmcv/utils/config.py", line 49, in getattr
raise ex
AttributeError: 'ConfigDict' object has no attribute 'optimizer_config'

@hbl843449791
Copy link
Author

似乎是配置文件中没有设置optimizer_config导致的

@TempleX98
Copy link
Collaborator

This repository does not support fp16 training.

@hbl843449791
Copy link
Author

hbl843449791 commented Aug 11, 2024

This repository does not support fp16 training.

mmdet.apis.train.py的182行
`

fp16 setting

fp16_cfg = cfg.get('fp16', None)
if fp16_cfg is not None:
    optimizer_config = Fp16OptimizerHook(
        **cfg.optimizer_config, **fp16_cfg, distributed=distributed)
elif distributed and 'type' not in cfg.optimizer_config:
    optimizer_config = OptimizerHook(**cfg.optimizer_config)
else:
    optimizer_config = cfg.optimizer_config

`
但是配置文件里面只有optimizer,没有optimizer_config,所以报的这个错

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