'Tensor' object has no attribute '_trt'
See original GitHub issueI get error AttributeError: 'Tensor' object has no attribute '_trt'
when I meet MaxPool2d
/usr/local/lib/python3.6/dist-packages/torch2trt-0.0.0-py3.6.egg/torch2trt/torch2trt.py in wrapper(*args, **kwargs) 95 96 #print(‘%s : %s’ % (method.qualname, converter.name)) —> 97 converter(ctx) 98 99 # convert to None so conversion will fail for unsupported layers
/usr/local/lib/python3.6/dist-packages/torch2trt-0.0.0-py3.6.egg/torch2trt/converters/MaxPool2d.py in convert_MaxPool2d(ctx) 21 22 layer = ctx.network.add_pooling( —> 23 input=input._trt, type=trt.PoolingType.MAX, window_size=kernel_size) 24 layer.stride = stride 25 layer.padding = padding
AttributeError: ‘Tensor’ object has no attribute ‘_trt’
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:12 (4 by maintainers)
Top GitHub Comments
HI @jaybdub ,
I’m trying to reproduce image segmentation example of this tutorial (Deeplabv3 model) and I have the following issue as in this topic.
Click to see the log
Any ideas why it does not work ?
Packages Versions
Hi All,
This is most likely because there Is a layer converter that has not been implemented. It is likely the layer before the one that threw the error (because the _trt was not set by the previous converter).
We’re focused on supporting the models in the README, but the coverage may increase over time.
@gavrin-s are you able to share the model you’re attempting to convert?
FYI, You can see the list of registered converters by typing
‘’’python import torch2trt
print(torch2trt.CONVERTERS) ‘’’
It may be possible to add support for the unsupported layers by using the ‘’@tensorrt_converter’’ method described in the README.md.
Please let me know if this helps or you have any other questions.
Best, John