-
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
Support regular expression in the mapping arg of copy_model_state
#6917
Conversation
Signed-off-by: KumoLiu <[email protected]>
for more information, see https://pre-commit.ci
According to Wenqi's comments and #6552 (comment), we can leave Since MONAI/monai/handlers/checkpoint_loader.py Line 138 in ef7debe
If you think this works, I can continue with this PR. Thanks. |
This reverts commit ed0ea9b. Signed-off-by: KumoLiu <[email protected]>
Signed-off-by: KumoLiu <[email protected]>
…ate-copy-model-state
…ate-copy-model-state
Signed-off-by: KumoLiu <[email protected]>
Signed-off-by: KumoLiu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: KumoLiu <[email protected]>
/build |
Part of #6552.
Description
After PR #6835, we have added
copy_model_args
in theload
API which can help us update the state_dict flexibly.https://github.com/KumoLiu/MONAI/blob/93a149a611b66153cf804b31a7b36a939e2e593a/monai/bundle/scripts.py#L397
Given this issue, we need to be able to filter the model's weights flexibly.
In
copy_model_state
, we already have a "mapping" arg, the filter will be more flexible if we can support regular expression in the mapping. This PR mainly added the support for regular expression for "mapping" arg.In the example in this issue, after this PR, we can do something like:
Additionally, based on the comments of Eric here, I totally agree, we could add a handler to make the pipeline easier to implement, but perhaps this task is no need to set as a "BundleTodo" for MONAIv1.3 but as an enhancement for MONAI near future.
What do you think? @ericspod @wyli @Nic-Ma
Types of changes
./runtests.sh -f -u --net --coverage
../runtests.sh --quick --unittests --disttests
.make html
command in thedocs/
folder.