I want to customize the optimizer(RAdam etc.), but I find that the optimizer in mmdetection is imported from torch.optim(only a few of optimizer are implemented), can you provide an official example to do this? Thank you
We will introduce an optimizer registry like dataset or model registry to support customizing the optimizer. As a walkaround now, you may just modify this line and get your own optimizer class.
OK, I'll try, thanks
It seems the custom optimizer documentation is out of date. How to use custom optimizer after the cleaning of optimizer code?
I figured out using this way:
from mmcv.runner.optimizer import build_optimizer, OPTIMIZERS
from my_optimizer import MyOptimizer
OPTIMIZERS.register_module()(MyOptimizer)
optim_cfg = dict(type="MyOptimizer", lr=0.001)
optimizer = build_optimizer(model, optim_cfg)
Most helpful comment
I figured out using this way: