Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to convert torch.embedding get me an error #404

Open
batrlatom opened this issue Sep 4, 2020 · 2 comments
Open

Trying to convert torch.embedding get me an error #404

batrlatom opened this issue Sep 4, 2020 · 2 comments

Comments

@batrlatom
Copy link

I am trying to convert model created by code from Karpathy: https://github.com/karpathy/minGPT and it uses embending layer which needs Long Tensor as an input. But torch2trt gives me an error TypeError: torch.int64 is not supported by tensorrt . I am using Jetson 4.4 with tensorrt 7.1+ which should convert it, but without any luck. Is there a possibility to make it work?

@Fan9
Copy link

Fan9 commented Apr 7, 2021

@batrlatom Do you fixed this problem?

@miaodl
Copy link

miaodl commented Dec 9, 2021

Traceback (most recent call last): File "trt_embedding_long_capability.py", line 41, in <module> main(args) File "trt_embedding_long_capability.py", line 28, in main embedding_trt = torch2trt(embedding, [x]) File "/usr/local/lib/python3.6/dist-packages/torch2trt-0.3.0-py3.6.egg/torch2trt/torch2trt.py", line 551, in torch2trt ctx.add_inputs(inputs, input_names) File "/usr/local/lib/python3.6/dist-packages/torch2trt-0.3.0-py3.6.egg/torch2trt/torch2trt.py", line 407, in add_inputs dtype=torch_dtype_to_trt(torch_input.dtype), File "/usr/local/lib/python3.6/dist-packages/torch2trt-0.3.0-py3.6.egg/torch2trt/torch2trt.py", line 38, in torch_dtype _to_trt raise TypeError("%s is not supported by tensorrt" % dtype) TypeError: torch.int64 is not supported by tensorrt

try to use newer docker image of L4T

https://catalog.ngc.nvidia.com/orgs/nvidia/containers/l4t-pytorch

2 step to fix this problem

  1. use this image

l4t-pytorch:r32.6.1-pth1.8-py3
PyTorch v1.8.0
torchvision v0.9.0
torchaudio v0.8.0

embedding layer of pt1.8 could support torch.int32.

  1. convert your input tensort to torch.IntTensor()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants