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
16.93k stars 4.14k forks source link

assertion error when using tensorflow_to_barracuda.py #2915

Closed MarkTension closed 4 years ago

MarkTension commented 4 years ago

hi all,

when using tensorflow_to_barracuda.py , with either a mobilenet_v2.pb or inception.pb model file I get either assert x.data.size == np.prod(shape) AssertionError

with inception,

or

assert all_elements_equal(input_ranks) AssertionError

with mobilenet_v2

I guess this is because of unsupported operations? If so, are there any other recommended models for image classification that don't have unsupported operations? Or any recommended ways to remove them?

Or maybe less problems with TensorflowSharp instead of barracuda?

Thanks!

MarkTension commented 4 years ago

Aah it seems that there was a problem with tensorflow 1.15 , and an older version of tensorflow_to_barracuda.py according to https://github.com/Unity-Technologies/ml-agents/issues/2775 . Updated the script to the latest version, and it works:)

ankur-00007 commented 4 years ago

I am not able to convert my .pb file to bytes using any of the above suggestions. My tf version is 1.15,,, request you to please guide which git branch i should take,,, have tried with master, 0.15 already,,

I am getting the same "Assertion Error " as detailed above

MarkTension commented 4 years ago

Maybe take that to the mlagents unity forum and specify what command, and kind of model. Custom model, or ml-agent generated etc. G'luck

chriselion commented 4 years ago

@ankur-00007 We haven't used .bytes files in a long time; I believe that was for using tensorflow sharp. You should refer to the documentation for the version of ML-Agents that you're using, or upgrade to the latest version and follow its documentation.

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.