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

performance advice, find_unused_parameters #8

Open
joihn opened this issue Dec 11, 2023 · 1 comment
Open

performance advice, find_unused_parameters #8

joihn opened this issue Dec 11, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@joihn
Copy link

joihn commented Dec 11, 2023

hello,
thanks for this code,

FYI this setting induce a big performance hit, leading to slow training,
configs/_gmmseg/models/base_model_config.py:1
find_unused_parameters = True

You probably added it because part of your network is not used during training (and will therefore generate an error, which you manage to workaround by using find_unused_parameters = True).

I think I found the unused part of the net.
You inherit BaseDecodeHead
mmseg/models/decode_heads/gmmseg_head.py:23
class GMMSegHead(BaseDecodeHead):

Which define an unused conv2d:
mmseg/models/decode_heads/decode_head.py:104
self.conv_seg = nn.Conv2d(channels, num_classes, kernel_size=1)

You can remote it. (del self.conv_seg in class GMMSegHead ) which would allow you to set find_unused_parameters = False and enjoy a nice speedup during training.

@leonnnop leonnnop added the enhancement New feature or request label Jan 20, 2024
@leonnnop leonnnop pinned this issue Jan 20, 2024
@leonnnop
Copy link
Owner

Thank you for bringing up the performance issue and investing your diligent effort in suggesting a potential solution!

I encourage future users to check for more details, and I have pinned this issue at the top. Hope this helps for future users.

Your valuable input is highly appreciated. Thank you once again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants