You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A strange thing came up at this point, I was printing the information of the call in the constructor and destructor functions I added in C++ in these two classes. python prints the information when called as follows:
The constructor of QnnModelLoader is called
The constructor of qnnInferenceEngine is called
The destructor of qnnInferenceEngine is called
Hello World
The destructor of QnnModelLoader is called
The destructor of qnnInferenceEngine is called
It makes me wonder why the destructor is called before Hello World.
Below I will provide a concrete implementation of the function load_model_from_qnn
For Load_model_from_qnn I tried using all the return mechanisms. But when I use it in Python all the print messages suggest me the same error, I don't know if I'm not using it correctly, my specific use is:
My core question is as follows.
1:In the PYBIND11_MODULE function, although the class QnnSampleApp appears, I don't want to expose it, and I don't know if I'm writing it this way correctly
2: Why the qnnInferenceEngine will be destructed in python directly after the creation of qnnInferenceEngine (the destruct message is printed in Hello World), is it because my PYBIND11_MODULE is not correct? If not, what should I do to change it?
If PYBIND11_MODULE is OK, is my load_model_from_qnn wrong? I've given the core details of the exact implementation, but it's fine in C++, and I know there are differences in the management mechanism between C++ and python, so how should I modify it?
Very much looking forward to your help, thanks!
Reproducible example code
Please refer to Problem description
Is this a regression? Put the last known working version here if it is.
Not a regression
The text was updated successfully, but these errors were encountered:
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
latest
Problem description
The python call to the pybind11 wrapped so file comes up with multiple destructions of my custom class。
My code for Pybind11 is as follows:
My python call code is as follows:
A strange thing came up at this point, I was printing the information of the call in the constructor and destructor functions I added in C++ in these two classes. python prints the information when called as follows:
It makes me wonder why the destructor is called before Hello World.
Below I will provide a concrete implementation of the function load_model_from_qnn
For Load_model_from_qnn I tried using all the return mechanisms. But when I use it in Python all the print messages suggest me the same error, I don't know if I'm not using it correctly, my specific use is:
I tried all of the following:
My core question is as follows.
1:In the PYBIND11_MODULE function, although the class QnnSampleApp appears, I don't want to expose it, and I don't know if I'm writing it this way correctly
2: Why the qnnInferenceEngine will be destructed in python directly after the creation of qnnInferenceEngine (the destruct message is printed in Hello World), is it because my PYBIND11_MODULE is not correct? If not, what should I do to change it?
If PYBIND11_MODULE is OK, is my load_model_from_qnn wrong? I've given the core details of the exact implementation, but it's fine in C++, and I know there are differences in the management mechanism between C++ and python, so how should I modify it?
Very much looking forward to your help, thanks!
Reproducible example code
Is this a regression? Put the last known working version here if it is.
Not a regression
The text was updated successfully, but these errors were encountered: