Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrate Python based TensorFlow into a .NET application [closed]

It seems that in order to fully use TensorFlow and associated libraries I need to access it from Python. Utilizing TensorFlow requires building rather complicated graphs which Python helper libraries (e.g. Keras) automate in sophisticated ways. I don't see a way to do that directly from .NET. See for example the respective GitHub discussion about C# support.

My idea is this: The main C# application will call into a Python application to access TensorFlow. That way most code will remain in C# land. I can use CPython which has full support for everything (IronPython does not).

How would I go about "calling into a Python application"? I assume I will need to run python.exe in a child process and make it execute commands. The child process will need to remain running between commands so that I can keep/share objects and data.

How would I best go about doing this? I don't quite know where to start.

like image 337
boot4life Avatar asked Jun 24 '17 19:06

boot4life


1 Answers

Have a look on this: https://github.com/migueldeicaza/TensorFlowSharp

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

like image 200
Ahmed Eissa Avatar answered Oct 15 '22 20:10

Ahmed Eissa