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

How can I convert my model? #38

Closed
ruyijidan opened this issue Aug 6, 2019 · 2 comments
Closed

How can I convert my model? #38

ruyijidan opened this issue Aug 6, 2019 · 2 comments

Comments

@ruyijidan
Copy link

model = alexnet(pretrained=True).eval().cuda()
it;s regular pytorch model
how can I convert my alexnet model ?

@jaybdub
Copy link
Contributor

jaybdub commented Aug 15, 2019

Hi ruyijidan,

Thanks for reaching out!

The main README has some documentation on how to convert alexnet.

Would you mind clarifying what issue you're running into?

Thanks,
John

@ruyijidan
Copy link
Author

Thank for reply!
I have know I just load_state_dict my model and torch2trt
but I got this:

File "/home/oeasy/Desktop/arcface_RT/test1/test5.py", line 20, in
model_trt = torch2trt(model, [x])
File "/home/oeasy/Desktop/arcface_RT/test1/torch2trt/torch2trt.py", line 252, in torch2trt
outputs = module(*inputs)
File "/home/oeasy/anaconda3/envs/tensorrt37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/home/oeasy/Desktop/arcface_RT/test1/resnet50/arcface_model.py", line 138, in forward
x = self.body(x)
File "/home/oeasy/anaconda3/envs/tensorrt37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/home/oeasy/anaconda3/envs/tensorrt37/lib/python3.7/site-packages/torch/nn/modules/container.py", line 92, in forward
input = module(input)
File "/home/oeasy/anaconda3/envs/tensorrt37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/home/oeasy/Desktop/arcface_RT/test1/resnet50/arcface_model.py", line 75, in forward
shortcut = self.shortcut_layer(x)
File "/home/oeasy/anaconda3/envs/tensorrt37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "/home/oeasy/Desktop/arcface_RT/test1/torch2trt/torch2trt.py", line 97, in wrapper
converter(ctx)
File "/home/oeasy/Desktop/arcface_RT/test1/torch2trt/converters/MaxPool2d.py", line 23, in convert_MaxPool2d
input=input._trt, type=trt.PoolingType.MAX, window_size=kernel_size)
AttributeError: 'Tensor' object has no attribute '_trt'

@jaybdub jaybdub closed this as completed Jul 18, 2022
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

2 participants