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

DiffusionModelUNet does not support torchscript #387

Closed
Can-Zhao opened this issue May 7, 2023 · 6 comments
Closed

DiffusionModelUNet does not support torchscript #387

Can-Zhao opened this issue May 7, 2023 · 6 comments

Comments

@Can-Zhao
Copy link

Can-Zhao commented May 7, 2023

DiffusionModelUNet does not support torchscript

There might be other issues. What I found is:
Type | is not supported for torchscript.

def forward(self, x: torch.Tensor, emb: torch.Tensor | None = None) -> torch.Tensor:

@ericspod
Copy link
Member

ericspod commented May 8, 2023

Is this dependent on Python version? We can use Optional in this file instead if that's the only places where | is used.

@Warvito
Copy link
Collaborator

Warvito commented May 8, 2023

Similar to MONAI Core, we adopted the use of from __future__ import annotations (Project-MONAI/MONAI#5836) (I guess it was adopted due to the new Python3.10+ syntax) and replaced most Union and Optional for the new syntax.

@ericspod
Copy link
Member

ericspod commented May 8, 2023

Similar to MONAI Core, we adopted the use of from __future__ import annotations (Project-MONAI/MONAI#5836) (I guess it was adopted due to the new Python3.10+ syntax) and replaced most Union and Optional for the new syntax.

That import was present at the top of the file in question so did that not work in this case?

@marksgraham
Copy link
Collaborator

@Can-Zhao did you make any progress with this when working on the diffusion bundle? I'm currently porting the networks to MONAI pr here and running into this issue again...

@Can-Zhao
Copy link
Author

Can-Zhao commented Nov 8, 2023

@Can-Zhao did you make any progress with this when working on the diffusion bundle? I'm currently porting the networks to MONAI pr here and running into this issue again...

No I was not working on it...

@marksgraham
Copy link
Collaborator

Closing. I was told on MONAI Core that it isn't necessary these models pass torchscript tests. Development of torchscript is frozen and may be replaced by another module.

@marksgraham marksgraham closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2023
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

No branches or pull requests

4 participants