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

[Feature] mmocr/models/common/losses/dice_loss.py add force=True #2061

Open
papayalove opened this issue Aug 14, 2024 · 0 comments
Open

[Feature] mmocr/models/common/losses/dice_loss.py add force=True #2061

papayalove opened this issue Aug 14, 2024 · 0 comments
Assignees

Comments

@papayalove
Copy link

What is the feature?

can you modify the code to:

@LOSSES.register_module(force=True)
class DiceLoss(nn.Module):

otherwise I will get:

'On January 1, 2023, MMCV will release v2.0.0, in which it will remove '
/opt/conda/envs/tablemaster3/lib/python3.7/site-packages/mmdet/datasets/pipelines/formating.py:7: UserWarning: DeprecationWarning: mmdet.datasets.pipelines.formating will be deprecated, please replace it with mmdet.datasets.pipelines.formatting.
warnings.warn('DeprecationWarning: mmdet.datasets.pipelines.formating will be '
Traceback (most recent call last):
File "table_recognition/tablemaster_infer.py", line 16, in
from mmocr.datasets import build_dataset # noqa: F401
File "/opt/conda/envs/tablemaster3/lib/python3.7/site-packages/mmocr/datasets/init.py", line 5, in
from .kie_dataset import KIEDataset
File "/opt/conda/envs/tablemaster3/lib/python3.7/site-packages/mmocr/datasets/kie_dataset.py", line 12, in
from mmocr.datasets.pipelines import sort_vertex8
File "/opt/conda/envs/tablemaster3/lib/python3.7/site-packages/mmocr/datasets/pipelines/init.py", line 6, in
from .ner_transforms import NerTransform, ToTensorNER
File "/opt/conda/envs/tablemaster3/lib/python3.7/site-packages/mmocr/datasets/pipelines/ner_transforms.py", line 4, in
from mmocr.models.builder import build_convertor
File "/opt/conda/envs/tablemaster3/lib/python3.7/site-packages/mmocr/models/init.py", line 3, in
from . import common, kie, textdet, textrecog
File "/opt/conda/envs/tablemaster3/lib/python3.7/site-packages/mmocr/models/common/init.py", line 1, in
from . import backbones, losses
File "/opt/conda/envs/tablemaster3/lib/python3.7/site-packages/mmocr/models/common/losses/init.py", line 1, in
from .dice_loss import DiceLoss
File "/opt/conda/envs/tablemaster3/lib/python3.7/site-packages/mmocr/models/common/losses/dice_loss.py", line 8, in
class DiceLoss(nn.Module):
File "/opt/conda/envs/tablemaster3/lib/python3.7/site-packages/mmcv/utils/registry.py", line 337, in _register
self._register_module(module=module, module_name=name, force=force)
File "/opt/conda/envs/tablemaster3/lib/python3.7/site-packages/mmcv/utils/misc.py", line 340, in new_func
output = old_func(*args, **kwargs)
File "/opt/conda/envs/tablemaster3/lib/python3.7/site-packages/mmcv/utils/registry.py", line 272, in _register_module
raise KeyError(f'{name} is already registered '
KeyError: 'DiceLoss is already registered in models'

Any other context?

No response

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