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

Potential 3D bug in EfficientNet Squeeze and Excitation layer #5574

Closed
swilson314 opened this issue Nov 23, 2022 · 4 comments · Fixed by #6672
Closed

Potential 3D bug in EfficientNet Squeeze and Excitation layer #5574

swilson314 opened this issue Nov 23, 2022 · 4 comments · Fixed by #6672
Assignees
Labels
bug Something isn't working Contribution wanted

Comments

@swilson314
Copy link

efficientnet.py

        if self.has_se:
            self._se_adaptpool = adaptivepool_type(1)
            num_squeezed_channels = max(1, int(in_channels * self.se_ratio))
            self._se_reduce = conv_type(in_channels=oup, out_channels=num_squeezed_channels, kernel_size=1)
            self._se_reduce_padding = _make_same_padder(self._se_reduce, [1, 1])
            self._se_expand = conv_type(in_channels=num_squeezed_channels, out_channels=oup, kernel_size=1)
            self._se_expand_padding = _make_same_padder(self._se_expand, [1, 1])

I believe the image_size = [1, 1] in _make_same_padder() should actually be [1, 1, 1] for the EfficientNet to support 3D. This is just by inspection, but I suspect this oversight came from extending 2D code.

@wyli
Copy link
Contributor

wyli commented Nov 24, 2022

agreed, would you like to contribute a fix?

@wyli wyli added bug Something isn't working Contribution wanted labels Nov 24, 2022
@swilson314
Copy link
Author

Great, yes. I'm new to Monai, are there any special instructions?

@wyli
Copy link
Contributor

wyli commented Nov 25, 2022

Sure, the contributing guide has some details https://github.com/Project-MONAI/MONAI/blob/dev/CONTRIBUTING.md and please let me know if you have any specific questions

@wyli
Copy link
Contributor

wyli commented Jun 28, 2023

Hi @yiheng-wang-nv could you please help fix this one, it seems #5695 had stalled.

@yiheng-wang-nv yiheng-wang-nv self-assigned this Jun 28, 2023
wyli pushed a commit that referenced this issue Jun 29, 2023
Fixes #5574 .

### Description

This PR is used to fix the `MBConvBlock` issue when `spatial_dims` is
not 2.
The PR follows the work in:
#5695
As it was not updated after review.
Thanks @swilson314 for posting the issue!

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Yiheng Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Contribution wanted
Projects
None yet
3 participants