question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[TensorRT] ERROR: INVALID_ARGUMENT: Cannot find binding of given name: input_0

See original GitHub issue

I implement a very simple network and try to convert it using torch2trt:

class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.conv1 = nn.Conv2d(1, 64, (5, 5), (1, 1), (2, 2))
        self.conv2 = nn.Conv2d(64, 32, (3, 3), (1, 1), (1, 1))
        ...... #omitted
    def forward(self, x):
        x = F.tanh(self.conv1(x))
        x = F.tanh(self.conv2(x))
        ......

I only use two conv2d layers and nothing else. The conversion code is like:

   model.load_state_dict(torch.load('epochs/' + MODEL_NAME))
    x = torch.randn([1, 1, 270, 480]).cuda()
   model_trt = torch2trt(model, [x], fp16_mode=True)

Simple, right?

When I use the model:

out = model_trt(image)
print(out.size())

it gives me this fucking error. I check the dimensions of “out”, and it shows: torch.Size([1, 1, 1, 2160, 3840]) If I do not convert the model, it works just fine, by giving: torch.Size([1, 1, 2160, 3840]), which is the target output I want.

I cannot just figure out why such simple code cannot be converted, and I do not know what this error means.

I use ubuntu18.04 cuda10.2, cudnn7.6.5 with trt 7.0.11, and the lateset torch2trt with plugin. ``

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
luhang-CCLcommented, May 23, 2020

I have an unsupported layer called: pixel_shuffle in my model, and I think it causes the problem: Warning: Encountered known unsupported method torch.nn.functional.pixel_shuffle If I comment out this layer, torch2trt works fine. It seems that this layer has added an extra dimension. Then, the problem is how I can live this unsupported layer?

0reactions
owoshchcommented, Aug 16, 2021

@hive-cas Hi! I have faced the same problem with pixel_shuffle layer in my network. Have you found the ready-to-use solution for this layer?

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TensorRT Error: Cannot find binding of given name
I have a 3 layer conventional neural network trained in Keras which takes in a [1,46] input and outputs 4 different classes at...
Read more >
YOLOv4 on tensorRT INVALID_ARGUMENT: Cannot find ...
[E] [TRT] INVALID_ARGUMENT: Cannot find binding of given name: ... i got the error only at the moment when i run it on...
Read more >
tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc
return errors::InvalidArgument("Input tensor rank is unknown."); ... We cannot support the following since TensorRT does not allow ... tensor binding.
Read more >
jetson-inference - Bountysource
After that pioled won't turn on, libnvrtc.so.10.2: cannot open shared object file: No such file or directory. I also get this error.
Read more >
"Fossies" - the Fresh Open Source Software Archive
312 return errors::InvalidArgument( 313 "Broadcasting requires at least one of ... can cause us to overwrite the name of the output 1181 //...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found