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

TensorRT Conversion Error #28

Open
Sayyam-Jain opened this issue Sep 14, 2020 · 3 comments
Open

TensorRT Conversion Error #28

Sayyam-Jain opened this issue Sep 14, 2020 · 3 comments

Comments

@Sayyam-Jain
Copy link

Sayyam-Jain commented Sep 14, 2020

I'm trying to convert the provided pth (small-satrn) model to tensorrt. But it shows the following error.

2020-09-14 14:05:55,032 - INFO - Use GPU 0
2020-09-14 14:05:55,032 - INFO - Set cudnn deterministic False
2020-09-14 14:05:55,032 - INFO - Set cudnn benchmark True
2020-09-14 14:05:55,032 - INFO - Set seed 1111
2020-09-14 14:05:55,032 - INFO - Build model
2020-09-14 14:05:55,036 - INFO - GResNet init weights
2020-09-14 14:05:55,348 - INFO - TransformerEncoder init weights
2020-09-14 14:05:55,891 - INFO - TransformerDecoder init weights
2020-09-14 14:05:56,001 - INFO - TransformerHead init weights
2020-09-14 14:05:57,158 - INFO - Load checkpoint from their.pth
2020-09-14 14:05:57,292 - INFO - Convert to trt engine with fp32
Dummy Input <class 'list'>
Traceback (most recent call last):
File "tools/deploy/export.py", line 99, in
main()
File "tools/deploy/export.py", line 92, in main
int8_mode=int8_mode, int8_calibrator=int8_calibrator)
File "/home/sayyam/anaconda3/envs/virtualenv/lib/python3.7/site-packages/volksdep-3.0.0-py3.7.egg/volksdep/converters/torch2trt.py", line 40, in torch2trt
torch2onnx(model, dummy_input, f)
File "/home/sayyam/anaconda3/envs/virtualenv/lib/python3.7/site-packages/volksdep-3.0.0-py3.7.egg/volksdep/converters/torch2onnx.py", line 46, in torch2onnx
output = model(dummy_input)
File "/home/sayyam/anaconda3/envs/virtualenv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "tools/deploy/../../vedastr/models/model.py", line 22, in forward
out = self.head(x, inputs[1])
File "/home/sayyam/anaconda3/envs/virtualenv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "tools/deploy/../../vedastr/models/heads/transformer_head.py", line 75, in forward
tgt = self.text_embedding(texts)
File "tools/deploy/../../vedastr/models/heads/transformer_head.py", line 54, in text_embedding
tgt = self.embedding(texts)
File "/home/sayyam/anaconda3/envs/virtualenv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "/home/sayyam/anaconda3/envs/virtualenv/lib/python3.7/site-packages/torch/nn/modules/sparse.py", line 114, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "/home/sayyam/anaconda3/envs/virtualenv/lib/python3.7/site-packages/torch/nn/functional.py", line 1724, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
TypeError: embedding(): argument 'indices' (position 2) must be Tensor, not list

Similar error (list has no attribute size) occurs when using TPS_Resnet-BiLSTM_Attention Model.
Please help.
Thanks

@ChaseMonsterAway
Copy link
Contributor

We just test resnet ctc model. There are some ops are not supported by TensorRT.

@ChaseMonsterAway
Copy link
Contributor

We will check it in the future. Please keep an eye on our work, volksdep.

@chophilip21
Copy link

any update on this issue?

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