You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: