getnamo / TensorFlow-Unreal

TensorFlow plugin for the Unreal Engine.
Other
1.15k stars 211 forks source link

Communication with C++ #33

Open biggoood opened 5 years ago

biggoood commented 5 years ago

Hi, there

I'm recently building a machine learning project in UE4 and trying to use this plugin to deploy a trained model. Is there any way to directly get the output data from tensorflow in C++?

Building environment: Windows 10 UE4.20 VS2015

Thanks for any help!

getnamo commented 5 years ago

The original idea was to support c++ api as well, but tensorflow is a very rapidly developing platform, as such this plugin uses the python bindings which makes it much easier to update to the latest version. Simply changing https://github.com/getnamo/tensorflow-ue4/blob/master/Content/Scripts/upymodule.json to your desired version will change your installation.

With that in mind if your model can be deployed using the python tensorflow api for inference, everything else should work as expected.

If you are intent on having a specific tensorflow version available for c++ inference, we then need to compile a static lib version of tensorflow for the desired build, see this issue: https://github.com/tensorflow/tensorflow/issues/5511 and https://github.com/peter1591/tensorflow-prebuilt for guidance. If you get something working, consider contributing with a pull request :)

getnamo commented 5 years ago

Future work for c++/native tensorflow will be found here: https://github.com/getnamo/tensorflow-native-ue4