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

Why it is not possible to pickle an InferenceSession object? #10097

Open
igaloly opened this issue Dec 21, 2021 · 3 comments
Open

Why it is not possible to pickle an InferenceSession object? #10097

igaloly opened this issue Dec 21, 2021 · 3 comments
Labels
feature request request for unsupported feature or enhancement

Comments

@igaloly
Copy link

igaloly commented Dec 21, 2021

Why it is not possible to pickle an InferenceSession object?
As I understand, this is because it's a CPP binding. Why it is a challenge? What will make it possible?

@oliviajain oliviajain added the feature request request for unsupported feature or enhancement label Dec 21, 2021
@jywu-msft
Copy link
Member

This issue came up long ago. Please take a look at the comments in #800 for the background context.

@igaloly
Copy link
Author

igaloly commented Dec 28, 2021

@jywu-msft
So, as I understand, this PR was rejected due to security concerns of loading a pickle in production, an argument that I totally agree with.

Nevertheless, I think InferenceSession should have the ability to be serialized and deserialized in a performant way because of the heavy-lifting that occurs in the initialization. See PR #10131 for more info.

What do you think?

@rth
Copy link

rth commented Aug 24, 2022

For anyone looking for a workaround for this, one was proposed in #800 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request request for unsupported feature or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants