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

Implementation of getSerializationSize and serialize #101

Open
LinHungShi opened this issue Oct 17, 2018 · 4 comments
Open

Implementation of getSerializationSize and serialize #101

LinHungShi opened this issue Oct 17, 2018 · 4 comments

Comments

@LinHungShi
Copy link

I am trying to write the engine to a plain file. It seems two related functions haven't been implemented yet. Is there any tutorial demonstrating how to implement these two functions?

@Alexey-Kamenev
Copy link
Collaborator

Not sure I understand the question. Are you asking in general how serialization should be implemented for plugins in TensorRT? Or specifically in Stereo DNN plugins? If former - then please refer to TensorRT documentation and samples. If latter - take a look at some of our plugins, for example this.

@LinHungShi
Copy link
Author

Hi @Alexey-Kamenev thanks for your reply. Since there're no weights in ELU layer, I am wondering how to serialize weight. To be more specific, do all layer variables need serialization? For example, there are dependencies between kernel_weights and kernel_weights_d_ in Conv3DPlugin, is it necessary to serialize both of them?

@Alexey-Kamenev
Copy link
Collaborator

In general, you should serialize all variables which are required to restore the plugin state correctly during deserialization (i.e. when deserialization ctor is called). That includes weights and biases in case of conv3d plugin. kernel_weights_d_ is just a device copy of kernel_weights_ so you only need to serialize one of them - kernel_weights_. Some variables which can be re-created do not require serialization, like various descriptors, auxiliary tensors etc.

@LinHungShi
Copy link
Author

Hi, your answer really saves my time. Do you mean I just need to serialize those important variables and recreate less important variables during deserialization?

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