Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to use a TF-hub saved_model in Unity

Discussion in 'ML-Agents' started by zwendi214, Apr 28, 2020.

  1. zwendi214

    zwendi214

    Joined:
    Mar 1, 2020
    Posts:
    1
    I plan to use "https://tfhub.dev/google/universal-sentence-encoder/4" 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-Technologi...raining-the-model-with-reinforcement-learning), it says I should assign a <behaviour_name>.nn file to the Model parameter.

    upload_2020-4-27_21-53-10.png

    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?
    upload_2020-4-27_21-55-13.png
     
  2. vincentpierre

    vincentpierre

    Joined:
    May 5, 2017
    Posts:
    160
    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 : https://github.com/Unity-Technologies/barracuda-release
     
    zwendi214 likes this.