grimoire / torch2trt_dynamic

A pytorch to tensorrt convert with dynamic shape support
MIT License
254 stars 34 forks source link

Hi, how to solve it with list output? #13

Open lucasjinreal opened 3 years ago

lucasjinreal commented 3 years ago

I got this error when using list as output:

line 408, in mark_outputs
    trt_tensor = torch_output._trt
AttributeError: 'list' object has no attribute '_trt'
grimoire commented 3 years ago

What is the output structure of your model? The convertor only accept tensor or list of tensors as output. Nested list is not convertable as the final output.

LeoRainly commented 2 years ago

I modified the output but I still got error AttributeError: 'Tensor' object has no attribute '_trt' in this function def mark_outputs(self, torchoutputs, names=None): if names is None: names = ['output%d' % i for i in range(len(torch_outputs))] ....... self.network.mark_output(trt_tensor)