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

Whether the files in the tools/analysis_tools/get_flops.py have not been corrected in time in mmsegmentation 1.0.0+? #2721

Closed
LovingThresh opened this issue Mar 9, 2023 · 2 comments
Assignees

Comments

@LovingThresh
Copy link

the build function is:

model = build_segmentor(
        cfg.model,
        train_cfg=cfg.get('train_cfg'),
        test_cfg=cfg.get('test_cfg')).cuda()

where the train_cfg is 'dict(by_epoch=True, max_epochs=100, val_interval=1 )' and test_cfg is 'dict()'.

In the build_segmentation function:

def build_segmentor(cfg, train_cfg=None, test_cfg=None):
    """Build segmentor."""
    if train_cfg is not None or test_cfg is not None:
        warnings.warn(
            'train_cfg and test_cfg is deprecated, '
            'please specify them in model', UserWarning)
    assert cfg.get('train_cfg') is None or train_cfg is None, \
        'train_cfg specified in both outer field and model field '
    assert cfg.get('test_cfg') is None or test_cfg is None, \
        'test_cfg specified in both outer field and model field '
    return SEGMENTORS.build(
        cfg, default_args=dict(train_cfg=train_cfg, test_cfg=test_cfg))

will have a error:

AssertionError: train_cfg specified in both outer field and model field.

And this part is alse extra:

    if hasattr(model,  'forward_dummy'):
        model.forward = model.forward_dummy
    else:
        raise NotImplementedError(
            'FLOPs counter is currently not currently supported with {}'.format(model.__class__.__name__))

It is necessary to update.

@LovingThresh LovingThresh changed the title Whether the files in the tools/analysis_tools/get_flops.py have not been corrected in time? Whether the files in the tools/analysis_tools/get_flops.py have not been corrected in time in mmsegmentation 1.0.0+? Mar 9, 2023
@xiexinch
Copy link
Collaborator

xiexinch commented Mar 9, 2023

#2706
It's in progress.

@xiexinch
Copy link
Collaborator

Hi @LovingThresh,
The pr #2706 has been merged.

aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this issue Mar 27, 2023
* TIME first commit

* styling.

* styling 2.

* fixes; tests

* apply styling and doc fix.

* remove sups.

* fixes

* remove temp file

* move augmentations to const

* added doc entry

* code quality

* customize augmentations

* quality

* quality

---------

Co-authored-by: Sayak Paul <[email protected]>
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

3 participants