Skip to content

Commit

Permalink
[Fix] Remove locations of not exists modules in the registry (#2829)
Browse files Browse the repository at this point in the history
## Motivation

If the module does not actually exist, setting locations will report an
error.

open-mmlab/mmengine#1010

## Modification

mmseg/registry/registry.py
  • Loading branch information
xiexinch committed Apr 3, 2023
1 parent 0e6f0e6 commit 4dc4ed9
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions mmseg/registry/registry.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright (c) OpenMMLab. All rights reserved.
"""MMSegmentation provides 17 registry nodes to support using modules across
"""MMSegmentation provides 21 registry nodes to support using modules across
projects. Each node is a child of the root registry in MMEngine.
More details can be found at
https://mmengine.readthedocs.io/en/latest/tutorials/registry.html.
https://mmengine.readthedocs.io/en/latest/advanced_tutorials/registry.html.
"""

from mmengine.registry import DATA_SAMPLERS as MMENGINE_DATA_SAMPLERS
Expand Down Expand Up @@ -46,10 +46,7 @@
# manage data-related modules
DATASETS = Registry(
'dataset', parent=MMENGINE_DATASETS, locations=['mmseg.datasets'])
DATA_SAMPLERS = Registry(
'data sampler',
parent=MMENGINE_DATA_SAMPLERS,
locations=['mmseg.datasets.samplers'])
DATA_SAMPLERS = Registry('data sampler', parent=MMENGINE_DATA_SAMPLERS)
TRANSFORMS = Registry(
'transform',
parent=MMENGINE_TRANSFORMS,
Expand Down Expand Up @@ -85,9 +82,7 @@
locations=['mmseg.engine.optimizers'])
# mangage all kinds of parameter schedulers like `MultiStepLR`
PARAM_SCHEDULERS = Registry(
'parameter scheduler',
parent=MMENGINE_PARAM_SCHEDULERS,
locations=['mmseg.engine.schedulers'])
'parameter scheduler', parent=MMENGINE_PARAM_SCHEDULERS)

# manage all kinds of metrics
METRICS = Registry(
Expand Down

0 comments on commit 4dc4ed9

Please sign in to comment.