Skip to content

3938 enhance milmodel for torchscript#3939

Draft
yiheng-wang-nv wants to merge 8 commits intoProject-MONAI:devfrom
yiheng-wang-nv:3938-enhance-milmodel-for-ts
Draft

3938 enhance milmodel for torchscript#3939
yiheng-wang-nv wants to merge 8 commits intoProject-MONAI:devfrom
yiheng-wang-nv:3938-enhance-milmodel-for-ts

Conversation

@yiheng-wang-nv
Copy link
Copy Markdown
Contributor

@yiheng-wang-nv yiheng-wang-nv commented Mar 15, 2022

Signed-off-by: Yiheng Wang vennw@nvidia.com

Fixes #3938 .

Description

With the changes, MILModel will support torchscript for all mil_mode.

Status

Work in progress

Types of changes

  • 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 <vennw@nvidia.com>
@yiheng-wang-nv yiheng-wang-nv requested a review from myron March 15, 2022 09:51
@myron
Copy link
Copy Markdown
Collaborator

myron commented Mar 23, 2022

this looks good, but shouldn't we support all modes?

@yiheng-wang-nv
Copy link
Copy Markdown
Contributor Author

this looks good, but shouldn't we support all modes?

Hi @myron , sure. To support att_trans_pyramid mode, the hook based method may need to be replaced. Let me update this PR for you to take a look.

Comment thread monai/networks/nets/milmodel.py Outdated
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
@yiheng-wang-nv
Copy link
Copy Markdown
Contributor Author

Hi @myron , to support att_trans_pyramid mode, the way of using def calc_head seems not feasible. Therefore I defined a new class and put everything of the att_trans_pyramid mode into it. The code may look quite different from your original version, could you please help to review it? Feel free to ask if you have any questions, thanks!

@yiheng-wang-nv
Copy link
Copy Markdown
Contributor Author

/black

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MILModel does not fully support torchscript

3 participants