Unverified Commit 7beabbdd authored by Sun Jiahao's avatar Sun Jiahao Committed by GitHub
Browse files

[Feature] Support auto import modules from registry. (#2314)

* fix polarmix UT

* add location

* fix base_inferencer scope
parent 108b3303
...@@ -5,7 +5,6 @@ import mmcv ...@@ -5,7 +5,6 @@ import mmcv
from mmdet3d.apis import inference_mono_3d_detector, init_model from mmdet3d.apis import inference_mono_3d_detector, init_model
from mmdet3d.registry import VISUALIZERS from mmdet3d.registry import VISUALIZERS
from mmdet3d.utils import register_all_modules
def parse_args(): def parse_args():
...@@ -38,9 +37,6 @@ def parse_args(): ...@@ -38,9 +37,6 @@ def parse_args():
def main(args): def main(args):
# register all modules in mmdet3d into the registries
register_all_modules()
# build the model from a config file and a checkpoint file # build the model from a config file and a checkpoint file
model = init_model(args.config, args.checkpoint, device=args.device) model = init_model(args.config, args.checkpoint, device=args.device)
......
...@@ -5,7 +5,6 @@ import mmcv ...@@ -5,7 +5,6 @@ import mmcv
from mmdet3d.apis import inference_multi_modality_detector, init_model from mmdet3d.apis import inference_multi_modality_detector, init_model
from mmdet3d.registry import VISUALIZERS from mmdet3d.registry import VISUALIZERS
from mmdet3d.utils import register_all_modules
def parse_args(): def parse_args():
...@@ -39,9 +38,6 @@ def parse_args(): ...@@ -39,9 +38,6 @@ def parse_args():
def main(args): def main(args):
# register all modules in mmdet3d into the registries
register_all_modules()
# build the model from a config file and a checkpoint file # build the model from a config file and a checkpoint file
model = init_model(args.config, args.checkpoint, device=args.device) model = init_model(args.config, args.checkpoint, device=args.device)
......
...@@ -3,7 +3,6 @@ from argparse import ArgumentParser ...@@ -3,7 +3,6 @@ from argparse import ArgumentParser
from mmdet3d.apis import inference_detector, init_model from mmdet3d.apis import inference_detector, init_model
from mmdet3d.registry import VISUALIZERS from mmdet3d.registry import VISUALIZERS
from mmdet3d.utils import register_all_modules
def parse_args(): def parse_args():
...@@ -30,9 +29,6 @@ def parse_args(): ...@@ -30,9 +29,6 @@ def parse_args():
def main(args): def main(args):
# register all modules in mmdet3d into the registries
register_all_modules()
# TODO: Support inference of point cloud numpy file. # TODO: Support inference of point cloud numpy file.
# build the model from a config file and a checkpoint file # build the model from a config file and a checkpoint file
model = init_model(args.config, args.checkpoint, device=args.device) model = init_model(args.config, args.checkpoint, device=args.device)
......
...@@ -3,7 +3,6 @@ from argparse import ArgumentParser ...@@ -3,7 +3,6 @@ from argparse import ArgumentParser
from mmdet3d.apis import inference_segmentor, init_model from mmdet3d.apis import inference_segmentor, init_model
from mmdet3d.registry import VISUALIZERS from mmdet3d.registry import VISUALIZERS
from mmdet3d.utils import register_all_modules
def parse_args(): def parse_args():
...@@ -28,9 +27,6 @@ def parse_args(): ...@@ -28,9 +27,6 @@ def parse_args():
def main(args): def main(args):
# register all modules in mmdet3d into the registries
register_all_modules()
# build the model from a config file and a checkpoint file # build the model from a config file and a checkpoint file
model = init_model(args.config, args.checkpoint, device=args.device) model = init_model(args.config, args.checkpoint, device=args.device)
......
...@@ -169,9 +169,7 @@ Case b: If you install MMDetection3D with MIM, open your python interpreter and ...@@ -169,9 +169,7 @@ Case b: If you install MMDetection3D with MIM, open your python interpreter and
```python ```python
from mmdet3d.apis import init_model, inference_detector from mmdet3d.apis import init_model, inference_detector
from mmdet3d.utils import register_all_modules
register_all_modules()
config_file = 'pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car.py' config_file = 'pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car.py'
checkpoint_file = 'hv_pointpillars_secfpn_6x8_160e_kitti-3d-car_20220331_134606-d42d15ed.pth' checkpoint_file = 'hv_pointpillars_secfpn_6x8_160e_kitti-3d-car_20220331_134606-d42d15ed.pth'
model = init_model(config_file, checkpoint_file) model = init_model(config_file, checkpoint_file)
......
...@@ -10,7 +10,7 @@ We list some potential troubles encountered by users and developers, along with ...@@ -10,7 +10,7 @@ We list some potential troubles encountered by users and developers, along with
| MMDetection3D version | MMEngine version | MMCV version | MMDetection version | | MMDetection3D version | MMEngine version | MMCV version | MMDetection version |
| --------------------- | :----------------------: | :---------------------: | :----------------------: | | --------------------- | :----------------------: | :---------------------: | :----------------------: |
| dev-1.x | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | | dev-1.x | mmengine>=0.4.0, \<1.0.0 | mmcv>=2.0.0rc4, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 |
| v1.1.0rc3 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | | v1.1.0rc3 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 |
| v1.1.0rc2 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | | v1.1.0rc2 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 |
| v1.1.0rc1 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | | v1.1.0rc1 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 |
......
...@@ -166,9 +166,7 @@ to_ply('./test.obj', './test.ply', 'obj') ...@@ -166,9 +166,7 @@ to_ply('./test.obj', './test.ply', 'obj')
```python ```python
from mmdet3d.apis import init_model, inference_detector from mmdet3d.apis import init_model, inference_detector
from mmdet3d.utils import register_all_modules
register_all_modules()
config_file = 'pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car.py' config_file = 'pointpillars_hv_secfpn_8xb6-160e_kitti-3d-car.py'
checkpoint_file = 'hv_pointpillars_secfpn_6x8_160e_kitti-3d-car_20220331_134606-d42d15ed.pth' checkpoint_file = 'hv_pointpillars_secfpn_6x8_160e_kitti-3d-car_20220331_134606-d42d15ed.pth'
model = init_model(config_file, checkpoint_file) model = init_model(config_file, checkpoint_file)
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
| MMDetection3D 版本 | MMEngine 版本 | MMCV 版本 | MMDetection 版本 | | MMDetection3D 版本 | MMEngine 版本 | MMCV 版本 | MMDetection 版本 |
| ------------------ | :----------------------: | :---------------------: | :----------------------: | | ------------------ | :----------------------: | :---------------------: | :----------------------: |
| dev-1.x | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | | dev-1.x | mmengine>=0.4.0, \<1.0.0 | mmcv>=2.0.0rc4, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 |
| v1.1.0rc3 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 |
| v1.1.0rc2 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | | v1.1.0rc2 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 |
| v1.1.0rc1 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | | v1.1.0rc1 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 |
| v1.1.0rc0 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 | | v1.1.0rc0 | mmengine>=0.1.0, \<1.0.0 | mmcv>=2.0.0rc0, \<2.1.0 | mmdet>=3.0.0rc0, \<3.1.0 |
......
...@@ -10,7 +10,7 @@ mmcv_minimum_version = '2.0.0rc0' ...@@ -10,7 +10,7 @@ mmcv_minimum_version = '2.0.0rc0'
mmcv_maximum_version = '2.1.0' mmcv_maximum_version = '2.1.0'
mmcv_version = digit_version(mmcv.__version__) mmcv_version = digit_version(mmcv.__version__)
mmengine_minimum_version = '0.1.0' mmengine_minimum_version = '0.4.0'
mmengine_maximum_version = '1.0.0' mmengine_maximum_version = '1.0.0'
mmengine_version = digit_version(mmengine.__version__) mmengine_version = digit_version(mmengine.__version__)
......
...@@ -11,6 +11,7 @@ import torch ...@@ -11,6 +11,7 @@ import torch
import torch.nn as nn import torch.nn as nn
from mmengine.config import Config from mmengine.config import Config
from mmengine.dataset import Compose, pseudo_collate from mmengine.dataset import Compose, pseudo_collate
from mmengine.registry import init_default_scope
from mmengine.runner import load_checkpoint from mmengine.runner import load_checkpoint
from mmdet3d.registry import MODELS from mmdet3d.registry import MODELS
...@@ -63,6 +64,7 @@ def init_model(config: Union[str, Path, Config], ...@@ -63,6 +64,7 @@ def init_model(config: Union[str, Path, Config],
convert_SyncBN(config.model) convert_SyncBN(config.model)
config.model.train_cfg = None config.model.train_cfg = None
init_default_scope(config.get('default_scope', 'mmdet3d'))
model = MODELS.build(config.model) model = MODELS.build(config.model)
if checkpoint is not None: if checkpoint is not None:
......
...@@ -7,12 +7,13 @@ import torch.nn as nn ...@@ -7,12 +7,13 @@ import torch.nn as nn
from mmengine.fileio import (get_file_backend, isdir, join_path, from mmengine.fileio import (get_file_backend, isdir, join_path,
list_dir_or_file) list_dir_or_file)
from mmengine.infer.infer import BaseInferencer, ModelType from mmengine.infer.infer import BaseInferencer, ModelType
from mmengine.registry import init_default_scope
from mmengine.runner import load_checkpoint from mmengine.runner import load_checkpoint
from mmengine.structures import InstanceData from mmengine.structures import InstanceData
from mmengine.visualization import Visualizer from mmengine.visualization import Visualizer
from mmdet3d.registry import MODELS from mmdet3d.registry import MODELS
from mmdet3d.utils import ConfigType, register_all_modules from mmdet3d.utils import ConfigType
InstanceList = List[InstanceData] InstanceList = List[InstanceData]
InputType = Union[str, np.ndarray] InputType = Union[str, np.ndarray]
...@@ -60,7 +61,7 @@ class BaseDet3DInferencer(BaseInferencer): ...@@ -60,7 +61,7 @@ class BaseDet3DInferencer(BaseInferencer):
scope: Optional[str] = 'mmdet3d', scope: Optional[str] = 'mmdet3d',
palette: str = 'none') -> None: palette: str = 'none') -> None:
self.palette = palette self.palette = palette
register_all_modules() init_default_scope(scope)
super().__init__( super().__init__(
model=model, weights=weights, device=device, scope=scope) model=model, weights=weights, device=device, scope=scope)
......
...@@ -9,7 +9,7 @@ from mmengine.infer.infer import ModelType ...@@ -9,7 +9,7 @@ from mmengine.infer.infer import ModelType
from mmengine.structures import InstanceData from mmengine.structures import InstanceData
from mmdet3d.registry import INFERENCERS from mmdet3d.registry import INFERENCERS
from mmdet3d.utils import ConfigType, register_all_modules from mmdet3d.utils import ConfigType
from .base_det3d_inferencer import BaseDet3DInferencer from .base_det3d_inferencer import BaseDet3DInferencer
InstanceList = List[InstanceData] InstanceList = List[InstanceData]
...@@ -62,7 +62,6 @@ class LidarDet3DInferencer(BaseDet3DInferencer): ...@@ -62,7 +62,6 @@ class LidarDet3DInferencer(BaseDet3DInferencer):
# naming of the output results # naming of the output results
self.num_visualized_frames = 0 self.num_visualized_frames = 0
self.palette = palette self.palette = palette
register_all_modules()
super().__init__( super().__init__(
model=model, weights=weights, device=device, scope=scope) model=model, weights=weights, device=device, scope=scope)
......
...@@ -33,54 +33,97 @@ from mmengine.registry import \ ...@@ -33,54 +33,97 @@ from mmengine.registry import \
from mmengine.registry import Registry from mmengine.registry import Registry
# manage all kinds of runners like `EpochBasedRunner` and `IterBasedRunner` # manage all kinds of runners like `EpochBasedRunner` and `IterBasedRunner`
RUNNERS = Registry('runner', parent=MMENGINE_RUNNERS) RUNNERS = Registry(
'runner', parent=MMENGINE_RUNNERS, locations=['mmdet3d.engine.runner'])
# manage runner constructors that define how to initialize runners # manage runner constructors that define how to initialize runners
RUNNER_CONSTRUCTORS = Registry( RUNNER_CONSTRUCTORS = Registry(
'runner constructor', parent=MMENGINE_RUNNER_CONSTRUCTORS) 'runner constructor',
parent=MMENGINE_RUNNER_CONSTRUCTORS,
locations=['mmdet3d.engine.runner'])
# manage all kinds of loops like `EpochBasedTrainLoop` # manage all kinds of loops like `EpochBasedTrainLoop`
LOOPS = Registry('loop', parent=MMENGINE_LOOPS) LOOPS = Registry(
'loop', parent=MMENGINE_LOOPS, locations=['mmdet3d.engine.runner'])
# manage all kinds of hooks like `CheckpointHook` # manage all kinds of hooks like `CheckpointHook`
HOOKS = Registry('hook', parent=MMENGINE_HOOKS) HOOKS = Registry(
'hook', parent=MMENGINE_HOOKS, locations=['mmdet3d.engine.hooks'])
# manage data-related modules # manage data-related modules
DATASETS = Registry('dataset', parent=MMENGINE_DATASETS) DATASETS = Registry(
DATA_SAMPLERS = Registry('data sampler', parent=MMENGINE_DATA_SAMPLERS) 'dataset', parent=MMENGINE_DATASETS, locations=['mmdet3d.datasets'])
TRANSFORMS = Registry('transform', parent=MMENGINE_TRANSFORMS) DATA_SAMPLERS = Registry(
'data sampler',
parent=MMENGINE_DATA_SAMPLERS,
locations=['mmdet3d.datasets.samplers'])
TRANSFORMS = Registry(
'transform',
parent=MMENGINE_TRANSFORMS,
locations=['mmdet3d.datasets.transforms'])
# mangage all kinds of modules inheriting `nn.Module` # mangage all kinds of modules inheriting `nn.Module`
MODELS = Registry('model', parent=MMENGINE_MODELS) MODELS = Registry(
'model', parent=MMENGINE_MODELS, locations=['mmdet3d.models'])
# mangage all kinds of model wrappers like 'MMDistributedDataParallel' # mangage all kinds of model wrappers like 'MMDistributedDataParallel'
MODEL_WRAPPERS = Registry('model_wrapper', parent=MMENGINE_MODEL_WRAPPERS) MODEL_WRAPPERS = Registry(
'model_wrapper',
parent=MMENGINE_MODEL_WRAPPERS,
locations=['mmdet3d.models'])
# mangage all kinds of weight initialization modules like `Uniform` # mangage all kinds of weight initialization modules like `Uniform`
WEIGHT_INITIALIZERS = Registry( WEIGHT_INITIALIZERS = Registry(
'weight initializer', parent=MMENGINE_WEIGHT_INITIALIZERS) 'weight initializer',
parent=MMENGINE_WEIGHT_INITIALIZERS,
locations=['mmdet3d.models'])
# mangage all kinds of optimizers like `SGD` and `Adam` # mangage all kinds of optimizers like `SGD` and `Adam`
OPTIMIZERS = Registry('optimizer', parent=MMENGINE_OPTIMIZERS) OPTIMIZERS = Registry(
'optimizer',
parent=MMENGINE_OPTIMIZERS,
locations=['mmdet3d.engine.optimizers'])
# manage optimizer wrapper # manage optimizer wrapper
OPTIM_WRAPPERS = Registry('optim wrapper', parent=MMENGINE_OPTIM_WRAPPERS) OPTIM_WRAPPERS = Registry(
'optim wrapper',
parent=MMENGINE_OPTIM_WRAPPERS,
locations=['mmdet3d.engine.optimizers'])
# manage constructors that customize the optimization hyperparameters. # manage constructors that customize the optimization hyperparameters.
OPTIM_WRAPPER_CONSTRUCTORS = Registry( OPTIM_WRAPPER_CONSTRUCTORS = Registry(
'optimizer wrapper constructor', 'optimizer wrapper constructor',
parent=MMENGINE_OPTIM_WRAPPER_CONSTRUCTORS) parent=MMENGINE_OPTIM_WRAPPER_CONSTRUCTORS,
locations=['mmdet3d.engine.optimizers'])
# mangage all kinds of parameter schedulers like `MultiStepLR` # mangage all kinds of parameter schedulers like `MultiStepLR`
PARAM_SCHEDULERS = Registry( PARAM_SCHEDULERS = Registry(
'parameter scheduler', parent=MMENGINE_PARAM_SCHEDULERS) 'parameter scheduler',
parent=MMENGINE_PARAM_SCHEDULERS,
locations=['mmdet3d.engine.schedulers'])
# manage all kinds of metrics # manage all kinds of metrics
METRICS = Registry('metric', parent=MMENGINE_METRICS) METRICS = Registry(
'metric', parent=MMENGINE_METRICS, locations=['mmdet3d.evaluation'])
# manage evaluator # manage evaluator
EVALUATOR = Registry('evaluator', parent=MMENGINE_EVALUATOR) EVALUATOR = Registry(
'evaluator', parent=MMENGINE_EVALUATOR, locations=['mmdet3d.evaluation'])
# manage task-specific modules like anchor generators and box coders # manage task-specific modules like anchor generators and box coders
TASK_UTILS = Registry('task util', parent=MMENGINE_TASK_UTILS) TASK_UTILS = Registry(
'task util', parent=MMENGINE_TASK_UTILS, locations=['mmdet3d.models'])
# manage visualizer # manage visualizer
VISUALIZERS = Registry('visualizer', parent=MMENGINE_VISUALIZERS) VISUALIZERS = Registry(
'visualizer',
parent=MMENGINE_VISUALIZERS,
locations=['mmdet3d.visualization'])
# manage visualizer backend # manage visualizer backend
VISBACKENDS = Registry('vis_backend', parent=MMENGINE_VISBACKENDS) VISBACKENDS = Registry(
'vis_backend',
parent=MMENGINE_VISBACKENDS,
locations=['mmdet3d.visualization'])
# manage logprocessor # manage logprocessor
LOG_PROCESSORS = Registry('log_processor', parent=MMENGINE_LOG_PROCESSORS) LOG_PROCESSORS = Registry(
'log_processor',
parent=MMENGINE_LOG_PROCESSORS,
# TODO: update the location when mmdet3d has its own log processor
locations=['mmdet3d.engine'])
# manage inferencer # manage inferencer
INFERENCERS = Registry('inferencer', parent=MMENGINE_INFERENCERS) INFERENCERS = Registry(
'inferencer',
parent=MMENGINE_INFERENCERS,
locations=['mmdet3d.api.inferencers'])
mmcv>=2.0.0rc0,<2.1.0 mmcv>=2.0.0rc4,<2.1.0
mmdet>=3.0.0rc0,<3.1.0 mmdet>=3.0.0rc0,<3.1.0
mmengine>=0.1.0,<1.0.0 mmengine>=0.4.0,<1.0.0
...@@ -3,9 +3,9 @@ import argparse ...@@ -3,9 +3,9 @@ import argparse
import torch import torch
from mmengine import Config, DictAction from mmengine import Config, DictAction
from mmengine.registry import init_default_scope
from mmdet3d.registry import MODELS from mmdet3d.registry import MODELS
from mmdet3d.utils import register_all_modules
try: try:
from mmcv.cnn import get_model_complexity_info from mmcv.cnn import get_model_complexity_info
...@@ -43,7 +43,6 @@ def parse_args(): ...@@ -43,7 +43,6 @@ def parse_args():
def main(): def main():
register_all_modules()
args = parse_args() args = parse_args()
if args.modality == 'point': if args.modality == 'point':
...@@ -64,6 +63,7 @@ def main(): ...@@ -64,6 +63,7 @@ def main():
cfg = Config.fromfile(args.config) cfg = Config.fromfile(args.config)
if args.cfg_options is not None: if args.cfg_options is not None:
cfg.merge_from_dict(args.cfg_options) cfg.merge_from_dict(args.cfg_options)
init_default_scope(cfg.get('default_scope', 'mmdet3d'))
model = MODELS.build(cfg.model) model = MODELS.build(cfg.model)
if torch.cuda.is_available(): if torch.cuda.is_available():
......
...@@ -3,10 +3,11 @@ import argparse ...@@ -3,10 +3,11 @@ import argparse
from os import path as osp from os import path as osp
from mmengine.config import Config, DictAction from mmengine.config import Config, DictAction
from mmengine.registry import init_default_scope
from mmengine.utils import ProgressBar, mkdir_or_exist from mmengine.utils import ProgressBar, mkdir_or_exist
from mmdet3d.registry import DATASETS, VISUALIZERS from mmdet3d.registry import DATASETS, VISUALIZERS
from mmdet3d.utils import register_all_modules, replace_ceph_backend from mmdet3d.utils import replace_ceph_backend
def parse_args(): def parse_args():
...@@ -99,8 +100,7 @@ def main(): ...@@ -99,8 +100,7 @@ def main():
if args.ceph: if args.ceph:
cfg = replace_ceph_backend(cfg) cfg = replace_ceph_backend(cfg)
# register all modules in mmdet3d into the registries init_default_scope(cfg.get('default_scope', 'mmdet3d'))
register_all_modules()
try: try:
dataset = DATASETS.build( dataset = DATASETS.build(
......
...@@ -7,7 +7,7 @@ from mmengine.config import Config, DictAction ...@@ -7,7 +7,7 @@ from mmengine.config import Config, DictAction
from mmengine.registry import RUNNERS from mmengine.registry import RUNNERS
from mmengine.runner import Runner from mmengine.runner import Runner
from mmdet3d.utils import register_all_modules, replace_ceph_backend from mmdet3d.utils import replace_ceph_backend
# TODO: support fuse_conv_bn and format_only # TODO: support fuse_conv_bn and format_only
...@@ -84,10 +84,6 @@ def trigger_visualization_hook(cfg, args): ...@@ -84,10 +84,6 @@ def trigger_visualization_hook(cfg, args):
def main(): def main():
args = parse_args() args = parse_args()
# register all modules in mmdet3d into the registries
# do not init the default scope here because it will be init in the runner
register_all_modules(init_default_scope=False)
# load config # load config
cfg = Config.fromfile(args.config) cfg = Config.fromfile(args.config)
......
...@@ -9,7 +9,7 @@ from mmengine.logging import print_log ...@@ -9,7 +9,7 @@ from mmengine.logging import print_log
from mmengine.registry import RUNNERS from mmengine.registry import RUNNERS
from mmengine.runner import Runner from mmengine.runner import Runner
from mmdet3d.utils import register_all_modules, replace_ceph_backend from mmdet3d.utils import replace_ceph_backend
def parse_args(): def parse_args():
...@@ -59,9 +59,6 @@ def parse_args(): ...@@ -59,9 +59,6 @@ def parse_args():
def main(): def main():
args = parse_args() args = parse_args()
# register all modules in mmdet3d into the registries
# do not init the default scope here because it will be init in the runner
register_all_modules(init_default_scope=False)
# load config # load config
cfg = Config.fromfile(args.config) cfg = Config.fromfile(args.config)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment