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

About the GFlops on the ADE20K dataset. #144

Open
SaulZhang opened this issue Oct 19, 2023 · 3 comments
Open

About the GFlops on the ADE20K dataset. #144

SaulZhang opened this issue Oct 19, 2023 · 3 comments

Comments

@SaulZhang
Copy link

Hi, I can not find the reported GFlops on the paper about the model Vit-Adapter-L (Mask2former/Beit v2/crop size 896), can you tell me the relevant data or the method to calculate it. Thanks a lot!

@czczup
Copy link
Owner

czczup commented Oct 20, 2023

Hi, I just uploaded the get_flops.py for calculating GFLOPs, you can try it.

@lianzheng-research
Copy link

I run the following command under the directory /ViT-Adapter/segmentation:
python get_flops.py configs/ade20k/upernet_deit_adapter_tiny_512_160k_ade20k.py
but got an error:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/mmcv/utils/registry.py", line 52, in build_from_cfg
return obj_cls(**args)
File "/usr/local/lib/python3.6/dist-packages/mmseg/models/segmentors/encoder_decoder.py", line 36, in init
self.backbone = builder.build_backbone(backbone)
File "/usr/local/lib/python3.6/dist-packages/mmseg/models/builder.py", line 20, in build_backbone
return BACKBONES.build(cfg)
File "/usr/local/lib/python3.6/dist-packages/mmcv/utils/registry.py", line 212, in build
return self.build_func(*args, **kwargs, registry=self)
File "/usr/local/lib/python3.6/dist-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg
return build_from_cfg(cfg, registry, default_args)
File "/usr/local/lib/python3.6/dist-packages/mmcv/utils/registry.py", line 45, in build_from_cfg
f'{obj_type} is not in the {registry.name} registry')
KeyError: 'ViTAdapter is not in the models registry'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "get_flops.py", line 100, in
test_cfg=cfg.get('test_cfg'))
File "/usr/local/lib/python3.6/dist-packages/mmseg/models/builder.py", line 49, in build_segmentor
cfg, default_args=dict(train_cfg=train_cfg, test_cfg=test_cfg))
File "/usr/local/lib/python3.6/dist-packages/mmcv/utils/registry.py", line 212, in build
return self.build_func(*args, **kwargs, registry=self)
File "/usr/local/lib/python3.6/dist-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg
return build_from_cfg(cfg, registry, default_args)
File "/usr/local/lib/python3.6/dist-packages/mmcv/utils/registry.py", line 55, in build_from_cfg
raise type(e)(f'{obj_cls.name}: {e}')
KeyError: "EncoderDecoder: 'ViTAdapter is not in the models registry'"
I need some help. Thank you very much!

@czczup
Copy link
Owner

czczup commented Nov 2, 2023

oh, you should import mmcv_custom and mmseg_custom at the begining of this code

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