Skip to content

✨[Feature] Possibility to export nn.InstanceNorm2d #3265

@albertodallolio

Description

@albertodallolio

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:

RuntimeError: [Error thrown at core/conversion/converters/impl/batch_norm.cpp:199] Expected instance_norm_plugin to be true but got false
Unable to create instance_norm plugin from TensorRT plugin registry%input.5 : Tensor = aten::instance_norm(%input.3, %16, %16, %16, %16, %14, %17, %18, %14), scope: __module.fnet/__module.fnet.norm1 # /opt/conda/lib/python3.11/site-packages/torch/nn/functional.py:2866:0

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:

pip install tensorrt==10.5.0
pip install torch_tensorrt

Thanks in advance for your help.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions