2532 revert dynunet change for backward compatibility#2534
Merged
diazandr3s merged 1 commit intoProject-MONAI:devfrom Jul 6, 2021
Merged
2532 revert dynunet change for backward compatibility#2534diazandr3s merged 1 commit intoProject-MONAI:devfrom
diazandr3s merged 1 commit intoProject-MONAI:devfrom
Conversation
Signed-off-by: Wenqi Li <[email protected]>
Contributor
Author
|
This PR resumes the previous module and test. It also passes this test: script adapted from https://github.com/Project-MONAI/MONAILabel/blob/main/sample-apps/deepedit_left_atrium/main.py import os
import torch
from monai.networks.nets.dynunet_v1 import DynUNetV1 as DynUNet
net = DynUNet(
spatial_dims=3,
in_channels=3,
out_channels=1,
kernel_size=[
[3, 3, 3],
[3, 3, 3],
[3, 3, 3],
[3, 3, 3],
[3, 3, 3],
[3, 3, 3],
],
strides=[
[1, 1, 1],
[2, 2, 2],
[2, 2, 2],
[2, 2, 2],
[2, 2, 2],
[2, 2, 1],
],
upsample_kernel_size=[
[2, 2, 2],
[2, 2, 2],
[2, 2, 2],
[2, 2, 2],
[2, 2, 1],
],
norm_name="instance",
deep_supervision=False,
res_block=True,
)
pretrained_model = os.path.join("deepedit_left_atrium.pt")
ckpt = torch.load(pretrained_model, map_location="cpu")
net.load_state_dict(ckpt)
print(ckpt) |
Contributor
Many thanks for this @wyli This solved the incompatibility issue! |
diazandr3s
approved these changes
Jul 6, 2021
Contributor
diazandr3s
left a comment
There was a problem hiding this comment.
Solves the incompatibility issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Wenqi Li [email protected]
Fixes #2532
Description
could import this module by
from monai.networks.nets.dynunet_v1 import DynUNetV1 as DynUNet(this version is from MONAI v0.5.3)
Status
Ready
Types of changes
./runtests.sh -f -u --net --coverage../runtests.sh --quick --unittests.make htmlcommand in thedocs/folder.