Unity-Technologies / ml-agents

The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement learning and imitation learning.
https://unity.com/products/machine-learning-agents
Other
17.12k stars 4.15k forks source link

Tensorflow.NET integration #4185

Closed flo-wolf closed 2 years ago

flo-wolf commented 4 years ago

Is your feature request related to a problem? Please describe. I am unable to train agents during runtime inside my builds, due to the python dependency. Currently ml-agents is Editor only.

Describe the solution you'd like Tensorflow.NET integration, creating full C# training support, allowing for runtime (live) training in builds.

Describe alternatives you've considered Bundling python into the build, which is very convoluted and creates a unnessessarily complex pipeline, which .NET integration would prevent.

Additional context Since Tensorflow.NET mimics all the possibilities you get from the python tensorflow, there would be no drawbacks in terms of features. Tensorflow.NET even includes its own version of NumPy fully translated into C#. I don't understand why this isn't considered. If it's possible to stick with only C#, why not go for it?

lostmsu commented 4 years ago

@flo-wolf you can try LostTech.TensorFlow that I just released. We have a ML Agents demo.

However, TensorFlow does not do well with AppDomain unloading and reloading, that Unity editor uses extensively. So you can use it in your game, but trying to use it in the editor will simply crash the editor. The demo I mentioned connects to the editor from outside - that works fine, and, honestly, easier to set up, since you can use NuGet to reference the necessary packages.

trsh commented 2 years ago

Any progress on this?

github-actions[bot] commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.