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.19k stars 4.16k forks source link

Convert .pb file to .nn file #2603

Closed SestoAle closed 5 years ago

SestoAle commented 5 years ago

Hi,

I have created a model with tensorflow and I saved it to a .pb file. Is there any way to convert the .pb file to the .nn file required by Unity?

weizhuang-93 commented 5 years ago

Hi @SestoAle ,

i tried using tensorflow_to_barracuda to convert to .nn but to no success. maybe u can try: https://github.com/Unity-Technologies/ml-agents/blob/master/UnitySDK/Assets/ML-Agents/Plugins/Barracuda.Core/Barracuda.md

incase i posted my issue here.. would be glad if you could tell me if u succeeded #2483

chriselion commented 5 years ago

@SestoAle - the tensorflow_to_barracuda script is used to convert .pb files to .nn files. You can see where this is used here: https://github.com/Unity-Technologies/ml-agents/blob/3a189a00afe170bab1c630a101cff2f3294f286d/ml-agents/mlagents/trainers/tf_policy.py#L230

However, we can only guarantee support for models that were generated by ML-Agents. Since you created you model on your own, the script may or may not work.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had activity in the last 14 days. It will be closed in the next 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 5 years ago

This issue has been automatically closed because it has not had activity in the last 28 days. If this issue is still valid, please ping a maintainer. Thank you for your contributions.

github-actions[bot] commented 3 years 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.