How to use a TF-hub saved_model in Unity

I plan to use “Google | universal-sentence-encoder | Kaggle” model to build a game in Unity. It’s my first time try the ml-agents plugin, so not sure how to do that.

The model I downloaded from TF-hub is a saved_model.pb file.

in ml-agents hub tutorial (https://github.com/Unity-Technologies/ml-agents/blob/latest_release/docs/Basic-Guide.md#training-the-model-with-reinforcement-learning), it says I should assign a <behaviour_name>.nn file to the Model parameter.

In the Youtube tutorial(

), it says I should assign a <model_name>.bytes file to the Model parameter.

I’m confused, what should I use?

The video tutorial you linked to is rather old. we changed the model file from bytes to nn why we stoped using TensorFlowSharp and started using the Unity Inference Engine instead.
ML-Agents only supports models trained with ML-Agents in games.
If you want to use the Unity Inference Engine to use your non-ML-Agents model in your game this is its github repository : GitHub - Unity-Technologies/barracuda-release

1 Like