0

I have two separate codes, one in C++ and one in Python. I create a TensorFlow model in python and load the model, train, and predict in C++. The problem is, I do not want to save the frozen graph(.pb file) in the local machine when I install the package for the client. I created a DLL in C++ from the python script. And I like to pass the model as a long String(or anything similar) from Python to C++ on the fly(without saving anything for security reasons.).

ga97rasl
  • 307
  • 2
  • 7
  • 15
  • 1
    Couldn't you pass the memory area from your Python frontend to your DLL, and then let the DLL read and use that memory area? You'd expose a method in your DLL that your Python code could call (probably similar to what you do now), with a pointer to the memory area that the DLL could read from (as shared memory). Or you could let the DLL listen to a named pipe or socket and accept data through that.. – MatsLindh Oct 13 '21 at 08:37
  • Thanks for the idea. But I do not know how to do it. Could you please explain it a little bit more? – ga97rasl Oct 18 '21 at 08:54
  • 1
    https://stackoverflow.com/questions/49103709/how-to-use-shared-memory-in-python-and-c-c/49118076 might give you an idea – MatsLindh Oct 18 '21 at 09:04
  • thanks it was a big help – ga97rasl Oct 19 '21 at 09:43

0 Answers0