NVIDIA-AI-IOT / torch2trt

An easy to use PyTorch to TensorRT converter
MIT License
4.6k stars 676 forks source link

AttributeError when using torch.nn.functional.pad #936

Open clementabary opened 4 months ago

clementabary commented 4 months ago

Hi all, when I run conversion of the following operation:

x_padded = torch.nn.functional.pad(x, (0, 0, pad_left, pad_right))

I get the error below:

AttributeError: 'tensorrt_bindings.tensorrt.INetworkDefinition' object has no attribute 'add_padding'. Did you mean: 'add_padding_nd'?

Do you know any way to circumvent this issue? Thanks in advance 🙏

lryain commented 1 month ago

Same error here!

itachi1232gg commented 1 month ago

you are probably using tensorrt10, INetworkDefinition.add_padding() is changed to INetworkDefinition.add_padding_nd()