-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
LocalNet Upsampling #5782
Labels
Comments
Maybe torch updated F.interpolate to use "nearest" by default in a recent update. In such case you should also check all F.interpolate uses? |
thanks for reporting, I'll make a PR to make it flexible. cc @yiheng-wang-nv do you have any experience of different interpolating modes here: MONAI/monai/networks/nets/dynunet.py Line 272 in c5ea694
|
wyli
added a commit
that referenced
this issue
Jan 5, 2023
Signed-off-by: Wenqi Li <[email protected]> Fixes #5782 ### Description - adds 'mode' and 'align_corners' options to the blocks and nets - fixes a few typos ### 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). - [x] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [x] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: Wenqi Li <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I've been using your LocalNet/GlobalNet and there was something off with my DDFs for a long time but couldn't think there was a direct error in your implementation. After checking it, there indeed is one small mistake.
Original is using Trilinear Upsampling (look at papers or DeepReg).
But here it is using F.interpolate which uses "Nearest" interpolation by default, both in
MONAI/monai/networks/blocks/regunet_block.py
Line 189 in 97918e4
MONAI/monai/networks/nets/regunet.py
Line 339 in 97918e4
Try looking at your output DDFs with LocalNet, it is really non-linear.
Changing both method to "trilinear" for 3D data fixes the problem and makes the DDFs smooth like in the LocalNet paper.
F.interpolate() => F.interpolate(mode="trilinear")
Linear/Bilinear/Trilinear depending on dimensions.
Thanks a lot for your hard work,
Franck
The text was updated successfully, but these errors were encountered: