torch2trt icon indicating copy to clipboard operation
torch2trt copied to clipboard

Warning: Encountered Known unsupported method torch.tensor & torch.Tensor.expand & torch.Tensor.get_device

Open 2dongheee opened this issue 5 years ago • 5 comments

Warning: Encountered Known unsupported method torch.tensor & torch.Tensor.expand & torch.Tensor.get_device

I have confirmed that there is no problem with the versions of Torch, Cuda, and Tensorrt.

but, after checking it, the weight is not converted properly and the object detection ability is reduced.

I think that warning is suspected when convert to weight, can you tell me how to solve it?

err err2

2dongheee avatar Jul 03 '20 10:07 2dongheee

I think you should write a plugin for Torch.tensor because there might be some new tensors initialized in your model.py. I met the same problem when I was writing the plugin for torch.new_empty. You can try to write a plugin with the tensorrt interfaces provided here.

czs1886 avatar Jul 13 '20 06:07 czs1886

I think you should write a plugin for Torch.tensor because there mightbe some new tensors initialized in your model.py. I met the same problem when I was writing the plugin for torch.new_empty. You can try to write a plugin with the tensorrt interfaces provided here.

czs1886 avatar Jul 13 '20 06:07 czs1886

Hello @czs1886 iam a nwe bies. I also met the same problem. but i dont understand you idea. could u explain for me more clearly

gioipv avatar Aug 04 '21 02:08 gioipv

for me. I just met the problem: Warning: Encountered known unsupported method torch.Tensor.expand_as . So i replace expand_as(..) in my model to expand(...). And it worked. Refer to https://pytorch.org/docs/stable/generated/torch.Tensor.expand_as.html

gioipv avatar Aug 04 '21 03:08 gioipv

for me. I just met the problem: Warning: Encountered known unsupported method torch.Tensor.expand_as . So i replace expand_as(..) in my model to expand(...). And it worked. Refer to https://pytorch.org/docs/stable/generated/torch.Tensor.expand_as.html

This is a very good approach, thanks for the answer

464hee avatar Jul 19 '23 03:07 464hee