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.

ERROR: infer_trtis_server.cpp:261 Triton: TritonServer response error received., triton_err_str:Internal, err_msg:PyTorch execute failure: Expected Tensor but got GenericDict

See original GitHub issue

I am trying to integrate a Torchscript classifier with Deepstream 6.0. The classifier outputs a dictionary:

{'output_1': tensor([[ 3.2155, -3.0554, -0.4579,  0.7352, -4.2501,  2.6455,  0.3411]],
        grad_fn=<MmBackward>),
 'output_2': tensor([[  3.8159,   6.6151, -10.7066,  -0.4239,  -1.1774,  -5.4879,  -2.1760]],
        grad_fn=<MmBackward>)}

I tried to integrate it with Triton Server but it seems that Triton doesn’t like the dictionary. Is there a way make it work either by retrieving the dictionary or any intermediate layer? For instance, it would be great if I could retrieve the layers upon which the dictionary is computed. Then, I could recompute the final the dictionary again “by myself”.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
mfogliocommented, Jan 3, 2022

In the end I decided to wrap the model like this:

class ModelWrapper(torch.nn.Module):

    def __init__(self, path):
        super(ModelWrapper, self).__init__()
        self.model = torch.jit.load(path, "cuda")

    def forward(self, x):
        output = self.model(x)
        return output["output_1"], output["output_2"]
0reactions
dziercommented, Dec 30, 2021

Even with the nvinferserver, Deepstream should work with Triton, meaning that it should output Tensor Data that Triton can use. I am not sure where the dictionary datatype comes from in Deepstream. Perhaps you should ask in the Deepstream forums, since the Triton team here are not very familiar with how Deepstream works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expected Tensor but got GenericList - PyTorch Forums
I converted the pytorch model to torch script.Loading the model using c++ was also successful. But while doing the inference,I got such an...
Read more >
Gst-nvinferserver — DeepStream 6.1.1 Release documentation
The Gst-nvinferserver plugin does inferencing on input data using NVIDIA® Triton Inference Server (previously called TensorRT Inference Server) ...
Read more >
Use Triton Inference Server with Amazon SageMaker
SageMaker enables customers to deploy a model using custom code with NVIDIA Triton Inference Server. This functionality is available through the development ...
Read more >
Triton on Vertex AI does not support multiple models?
Currently, I want to deploy a Triton server to Vertex AI endpoint. However I received this error message. "failed to start Vertex AI ......
Read more >
"expected CPU tensor(got CUDA tensor)" error for PyTorch
Probably the error is a mismatch between the model which is in cuda and the variable x you are using as an input,...
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