Integrate Python-based TensorFlow in a .NET Application

It seems that to make full use of TensorFlow and its associated libraries, I need to access it with Python. Using TensorFlow requires creating fairly complex graphs that automate complex Python helper libraries (such as Keras) in complex ways. I see no way to do this directly from .NET. See, for example, the relevant GitHub discussion on C # support .

My idea is this: the main C # application is called in a Python application to access TensorFlow. That way, most of the code will remain in C # land. I can use CPython, which fully supports everything (IronPython does not).

How can I "invoke a Python application"? I assume that I will need to run python.exe in a child process and make it execute commands. The child process must remain between the teams so that I can store / exchange objects and data.

How am I best to do this? I don’t quite know where to start.

+5
source share
1 answer

Take a look at this: https://github.com/migueldeicaza/TensorFlowSharp

TensorFlowSharp are .NET bindings to the TensorFlow library. This covers the C API as a strongly typed .NET API for use with C # and F #.

+1
source

Source: https://habr.com/ru/post/1269181/


All Articles