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 use the TRT engine that has interpolation layers in C++? #353

Open
bitwangdan opened this issue Jun 28, 2020 · 2 comments
Open

Comments

@bitwangdan
Copy link

@jaybdub hi, Can you give me some advice?

@jaybdub
Copy link
Contributor

jaybdub commented Jul 2, 2020

Hi bitwangdan,

Thanks for reaching out!

First, you'll need to export the engine

with open('my_model.engine', 'wb') as f:
    f.write(my_model.engine.serialize())

Next, you would need to load the model in C++. For this, I'd refer to the TensorRT documentation.

For plugins specifically, you'll need to link against the compiled library and register the plugins in C++. I haven't tested this personally.

Are you able to use TensorRT 7.1+? If so, interpolation is natively supported in TensorRT, and you should not need to link against any special plugin library.

Best,
John

@monsterlyg
Copy link

Hi bitwangdan,

Thanks for reaching out!

First, you'll need to export the engine

with open('my_model.engine', 'wb') as f:
    f.write(my_model.engine.serialize())

Next, you would need to load the model in C++. For this, I'd refer to the TensorRT documentation.

For plugins specifically, you'll need to link against the compiled library and register the plugins in C++. I haven't tested this personally.

Are you able to use TensorRT 7.1+? If so, interpolation is natively supported in TensorRT, and you should not need to link against any special plugin library.

Best,
John

I try to use the engine converted with torch2trt with plugins in c++. But actually, as you said, thr plugin should be registered in c++, how to figure out this problem? Do you have any instruction?

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