Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
I am exploring the possibility of training a model in Unity using the ML-Agents package, then exporting that model for use with Tensorflow.js in the browser. Eventually, I'd like to incorporate that model into ml5.js, an approachable wrapper library around tf.js. I think this workflow would be an exciting use of the training / curriculum learning structure of Unity, and allow people to create models which could be used in online demonstrations of reinforcement learning (...or maybe agent-based AI for online games?)
Currently, it is possible to convert Tensorflow models for use with Tensorflow.js as long as they are in the SavedModel, Keras model, or TensorFlow Hub module format.
Describe the solution you'd like
Any information about this would be most appreciated!
A (vaguely) related issue:
This runs without error, but produces a SavedModel without any Signature Definitions, as seen when I run the
This then throws an error when converting to TFJS using the tfjs-converter:
along with many warnings like this:
If anyone can shed light on how to include SignatureDefs in the exported model, and export a valid SavedModel from Unity ML-Agents, that would be awesome!
For anyone trying to use models from Unity in TensorFlow.js, here is the approach I took.
If anyone can clarify the different output nodes: