Closed bigsum71 closed 2 years ago
I have same problem. How can I solve this?
[TensorRT] ERROR: (Unnamed Layer* 72) [Slice]: mismatch in number of dimensions for start. Traceback (most recent call last): File "convert.py", line 716, in <module> model_trt = torch2trt(model, [x]) File "/usr/local/lib/python3.6/dist-packages/torch2trt/torch2trt.py", line 377, in torch2trt outputs = module(*inputs) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 532, in __call__ result = self.forward(*input, **kwargs) File "convert.py", line 407, in forward max_conf, _ = torch.max(conf_x[:, 0:3, :, :], dim=1, keepdim=False) File "/usr/local/lib/python3.6/dist-packages/torch2trt/torch2trt.py", line 202, in wrapper converter['converter'](ctx) File "/usr/local/lib/python3.6/dist-packages/torch2trt/converters/max.py", line 32, in convert_max __convert_max_reduce(ctx) File "/usr/local/lib/python3.6/dist-packages/torch2trt/converters/max.py", line 19, in __convert_max_reduce input_trt= trt_(ctx.network, input) File "/usr/local/lib/python3.6/dist-packages/torch2trt/torch2trt.py", line 116, in trt_ num_dim = len(t._trt.shape) # non-leaf tensors must already have _trt, get shape from that ValueError: __len__() should return >= 0
I have same problem. How can I solve this?
[TensorRT] ERROR: (Unnamed Layer* 72) [Slice]: mismatch in number of dimensions for start. Traceback (most recent call last): File "convert.py", line 716, in <module> model_trt = torch2trt(model, [x]) File "/usr/local/lib/python3.6/dist-packages/torch2trt/torch2trt.py", line 377, in torch2trt outputs = module(*inputs) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 532, in __call__ result = self.forward(*input, **kwargs) File "convert.py", line 407, in forward max_conf, _ = torch.max(conf_x[:, 0:3, :, :], dim=1, keepdim=False) File "/usr/local/lib/python3.6/dist-packages/torch2trt/torch2trt.py", line 202, in wrapper converter['converter'](ctx) File "/usr/local/lib/python3.6/dist-packages/torch2trt/converters/max.py", line 32, in convert_max __convert_max_reduce(ctx) File "/usr/local/lib/python3.6/dist-packages/torch2trt/converters/max.py", line 19, in __convert_max_reduce input_trt= trt_(ctx.network, input) File "/usr/local/lib/python3.6/dist-packages/torch2trt/torch2trt.py", line 116, in trt_ num_dim = len(t._trt.shape) # non-leaf tensors must already have _trt, get shape from that ValueError: __len__() should return >= 0
me too!Have you solved the problem yet?
I converted to TRT just before the error. The conversion was successful, but the output was very different from before the conversion. I dealt with pytorch → onnx → tensorrt.
Dooray! 메일 발송 실패 안내
메일 발송 실패 안내
@.***) 님께 보낸 메일이 전송되지 못하였습니다.
실패 사유를 확인해보세요.
* 받는 사람 :
@.***)
* 발송 시간 :
2022-07-19T06:02:44
* 메일 제목 :
Re: [NVIDIA-AI-IOT/torch2trt] ERROR : num_dim = len(t._trt.shape) (#303)
* 실패 사유 :
받는 사람이 회원님의 메일을 수신차단 하였습니다.
이 메일은 발신전용으로 회신되지 않습니다.
더 궁금하신 사항은
***@***.***
으로 문의해 주시기 바랍니다.
© Dooray!.
Can anyone solve this issue?
Dooray! 메일 발송 실패 안내
메일 발송 실패 안내
@.***) 님께 보낸 메일이 전송되지 못하였습니다.
실패 사유를 확인해보세요.
* 받는 사람 :
@.***)
* 발송 시간 :
2023-12-04T18:22:10
* 메일 제목 :
Re: [NVIDIA-AI-IOT/torch2trt] ERROR : num_dim = len(t._trt.shape) (#303)
* 실패 사유 :
받는 사람이 회원님의 메일을 수신차단 하였습니다.
이 메일은 발신전용으로 회신되지 않습니다.
더 궁금하신 사항은
***@***.***
으로 문의해 주시기 바랍니다.
© Dooray!.
I have an error related to "len(t._trt.shape)". My network has "torch.max()" and this "torch.max()" has conversion error. Through the debugging I found "t._trt" attribute had shape 0 and so "len(t.trt.shape)" might have that error. If you know the solution, please let me know. Thank you!
========================================================== def forward(self, x): x = self.filter(x) out = torch.split(x, self.out_channels, 1)
=========================================================