torch2trt
torch2trt copied to clipboard
AttributeError: 'Tensor' object has no attribute '_trt'
I'm currently trying to use torch2trt on my Jetson Nano. See below for the jetson_release
info for this device:
- NVIDIA Jetson Nano (Developer Kit Version)
* Jetpack 4.4 DP [L4T 32.4.2]
* NV Power Mode: MAXN - Type: 0
* jetson_clocks service: inactive
- Libraries:
* CUDA: 10.2.89
* cuDNN: 8.0.0.145
* TensorRT: 7.1.0.16
* Visionworks: 1.6.0.501
* OpenCV: 4.1.1 compiled CUDA: NO
* VPI: 0.2.0
* Vulkan: 1.2.70
Note that I've confirmed that the sample usage code given here runs without issue on this device.
I've cloned torch2trt
and installed it with plugin support on my Nano, but am unable to successfully to convert my object detection pytorch model to a TensorRT engine. Specifically, the error that returns when I call model_trt = torch2trt(model, [x])
is as follows:
Traceback (most recent call last):
File "test.py", line 9, in <module>
model_trt = torch2trt(retinanet, [x])
File "/usr/local/lib/python3.6/dist-packages/torch2trt/torch2trt.py", line 377, in torch2trt
outputs = module(*inputs)
File "/home/nvidia/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
result = self.forward(*input, **kwargs)
File "/home/nvidia/projects/object_detection/retinanet/model.py", line 259, in forward
transformed_anchors = self.regressBoxes(anchors, regression)
File "/home/nvidia/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
result = self.forward(*input, **kwargs)
File "/home/nvidia/projects/object_detection/retinanet/utils.py", line 104, in forward
widths = boxes[:, :, 2] - boxes[:, :, 0]
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/getitem.py", line 31, in convert_tensor_getitem
input_trt = input._trt
AttributeError: 'Tensor' object has no attribute '_trt'
Since the error appears to be with the getitem
converter, I tried running python3 -m torch2trt.test --name=getitme
from the top level torch2trt directory, but no output is printed.
What can I do to solve this issue?
I encountered the same problem. Any solution?
I encountered the same problem. Any solution?
Same problem with yours, solved?
Any updates on this?
same problem,who can solve it?@jaybdub
same here
Same problem, how did you able to solve it?
same error, any updates?
same