-
Notifications
You must be signed in to change notification settings - Fork 350
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
✨[Feature] Possibility to export nn.InstanceNorm2d #3265
Comments
Are you able to use the dynamo frontend @albertodallolio? You can still use TorchScript after if needed. But dynamo has way more comprehensive coverage of the PyTorch opset |
Thanks a lot for the fast response. I think your suggestion moved something. I am now getting a different error:
This is the code I am running:
Any idea what the error might be? I was actually planning to use dynamic input images, so it would be great to make it work with Dynamo. Thanks a lot |
@peri044 can you take a look at the dynamic shape issue here? Do you know if all values need to be satisfied in range or just the bounds and some intermediate values? My best guess is this is probably telling you that the lower bound does not fit properly with the shapes further into the network.
|
It seems that ALL values in the range |
There are guards that are generated internally by dynamo by Pytorch which sometimes error out. Could you try exporting using |
Hey @peri044 thanks for your suggestion. Maybe a stupid question from my side: how should I parametrize the
Reposting my
Thanks a lot in advance again for your help. Highly appreciated 👍 |
Also, I am failing to run Getting:
My pytorch version is:
|
@albertodallolio The
Step 1) is failing in your case. from torch.export._trace import _export Here's a reference for configuring dynamic shapes : https://pytorch.org/tutorials/intermediate/torch_export_tutorial.html#constraints-dynamic-shapes In your case, I believe it would probably be something like this (checkout the above references dim_2 = torch.export.Dim("dim_2", min=135, max=2160)
dim_3 = torch.export.Dim("dim_3", min=135, max=3840)
dynamic_shapes = ({2: dim_2, 3: dim_3}, {2: dim_2, 3: dim_3},) |
Thanks for your suggestion. I thin we are actually getting closer: the export step passed through (with a bunch of warnings) but now the compile steps errors out with:
Looks like it is failing somewhere here. But I printed the nodes of the exported graph as below and could not find
My code is now:
Thanks a lot for your help. |
This seems like at torch-tensorrt bug, we can take a look |
What
I am trying to export a model that contains
nn.InstanceNorm2d
(the call from the module can be found here) operation and I get the following error:If I understand correctly this issue comes from the fact that there is no conversion for such operation. I know that there is one for instance_norm though. Do you have alternative solutions you can suggest?
My workspace
Docker image from pytorch:
pytorch/pytorch:2.5.0-cuda12.1-cudnn9-devel
then run:
Thanks in advance for your help.
The text was updated successfully, but these errors were encountered: