Convert monai model to onnx model #4076
Unanswered
RegoResearch
asked this question in
Q&A
Replies: 3 comments 2 replies
-
Hi @YuanTingHsieh , I remember you did some experiments on ONNX conversion before, could you please help share some info here? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi, I was using the following code to check if ONNX export success or not.
|
Beta Was this translation helpful? Give feedback.
2 replies
-
Hi, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I want to convert a monai model (such as SegResNet and UNet of monai.networks.nets) to ONNX.
In my case, I use DataParallel for multiple GPUs, and I want to use the trained model to make inferences on the c++ platform as well.
I think I have two choices as below:
In case of 1,
I found the article that TorchScript does not support "DataParallel" yet, and I actually failed to use torch.jit.save with the error below:
"Could not export Python function call 'Scatter'. Remove calls to Python functions before export. Did you forget to add @script or @script_method annotation? If this is a nn.ModuleList, add it to constants"
In case of 2,
It seems to be worked, but the output generated using the onnx model are completely different from the inference result using monai python code.
How can I convert a trained monai model with DataParallel to onnx or other compatible model?
I look forward to your answer.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions