Search Unity

.nn to keras model

Discussion in 'ML-Agents' started by unity_bvYSjU_BlRS8eA, Jun 30, 2020.

  1. unity_bvYSjU_BlRS8eA

    unity_bvYSjU_BlRS8eA

    Joined:
    Jun 30, 2020
    Posts:
    2
    How can I export my .nn model into Keras .h5 model in unity ml agents?
     
  2. andrzej_

    andrzej_

    Joined:
    Dec 2, 2016
    Posts:
    81
    I'm pretty sure someone from the Unity team will have more reliable information, but I'd personally try with the protobuf file that is created during training. Both protobuf and HDF5 store the graph and weights so I'm sure there are plenty of ways to convert it.
     
  3. ervteng_unity

    ervteng_unity

    Unity Technologies

    Joined:
    Dec 6, 2018
    Posts:
    150
    Converting the .nn to other formats is not supported. I'd try to convert the Tensorflow models (
    frozen_graph.pb
    ) that are created after training; they can be found in the
    results/run_id/behavior_name
    folder after training.
     
  4. unity_bvYSjU_BlRS8eA

    unity_bvYSjU_BlRS8eA

    Joined:
    Jun 30, 2020
    Posts:
    2
    I think there should be a way to save a model into .h5, it would way easier to get the model. Also I was thinking to train a DRL model in unity, and test it in real-world hardware, so I need a simple Keras model that has trained in unity environment , but I can inference it in real world, is that possible ?