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

Linking the Custom plugins for the Conversion(while converting from ONNX to TRT Model) #5

Open
Darshcg opened this issue Feb 20, 2021 · 5 comments

Comments

@Darshcg
Copy link

Darshcg commented Feb 20, 2021

Hi @TrojanXu,

Thanks for your wonderful work.

I have Implemented two custom Plugins for two unsupported Ops. I want to link those custom Plugins for the conversion(while converting from ONNX to TRT Model). Can you please assist me in doing the same? Would be a great help.

Thanks and Regards,
Darshan

@Darshcg
Copy link
Author

Darshcg commented Feb 21, 2021

Hi @TrojanXu ,

Actually, I am facing difficulty during converting the ONNX model to TRT with a Custom plugin. It would be a great help if you can help me in the same.

Waiting for your reply.

Thanks,
Darshan

@TrojanXu
Copy link
Owner

With latest TRT release, you can modify the onnx file to map the onnx op to a TRT plugin op, refer to https://github.com/TrojanXu/onnxparser-trt-plugin-sample/blob/master/test_plugin_result.py#L116

@Darshcg
Copy link
Author

Darshcg commented Feb 21, 2021

Hi @TrojanXu,

Thanks for your kind reply.

For now, I have created the .so files for the two custom Plugins. What are the next steps? (what are the commands?). As I am doing this for the first time, your help would be highly appreciable. Do I need to do anything with the TRT OSS Project?.

Environment:
TRT Version: 7.1.3
CUDA: 10.2
OS: Ubuntu 18.04.
GPU: RTX 2060.

Thanks and Regards,
Darshan C G

@Darshcg
Copy link
Author

Darshcg commented Feb 21, 2021

Hi @TrojanXu ,

I got to know about the same. It is about including the .so file while conversion.
Example: ./trtexec --onnx=model.onnx --explicitBatch --shapes=input1:1x1x1x1 --plugins=layer.so

But when I run this I am getting an issue as: Einsum_194: PluginV2Layer must be V2DynamicExt when there are runtime input dimensions

The image of the error has been attached below:
Screenshot from 2021-02-22 01-04-57

Can you please help me to resolve this error? Where Exactly I am going wrong? what's the solution for this?

Thanks and Regards,
Darshan C G

@TrojanXu
Copy link
Owner

You used "--shapes=input1:1x1x1x1", it means the network is using dynamic shape. Just as the error said, you need to extend V2DynamicExt class instead of PluginV2

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