Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TFException: Shape [-1,24] has negative dimensions #24

Closed
sterlingcrispin opened this issue Sep 21, 2017 · 5 comments
Closed

TFException: Shape [-1,24] has negative dimensions #24

sterlingcrispin opened this issue Sep 21, 2017 · 5 comments

Comments

@sterlingcrispin
Copy link
Contributor

I was running a training session in the PPO notebook and stopped it , then exported the graph

INFO:tensorflow:Restoring parameters from ./models/ppo/model-400000.cptk
Converted 4 variables to const ops.
20 ops in the final graph.

but when I use this .bytes file in Unity I get

TFException: Shape [-1,24] has negative dimensions [[Node: epsilon = Placeholder[dtype=DT_FLOAT, shape=[?,24], _device="/job:localhost/replica:0/task:0/cpu:0"]()]] TensorFlow.TFStatus.CheckMaybeRaise (TensorFlow.TFStatus incomingStatus, System.Boolean last) (at <6ed6db22f8874deba74ffe3e566039be>:0) TensorFlow.TFSession.Run (TensorFlow.TFOutput[] inputs, TensorFlow.TFTensor[] inputValues, TensorFlow.TFOutput[] outputs, TensorFlow.TFOperation[] targetOpers, TensorFlow.TFBuffer runMetadata, TensorFlow.TFBuffer runOptions, TensorFlow.TFStatus status) (at <6ed6db22f8874deba74ffe3e566039be>:0) TensorFlow.TFSession+Runner.Run (TensorFlow.TFStatus status) (at <6ed6db22f8874deba74ffe3e566039be>:0) CoreBrainInternal.DecideAction () (at Assets/ML-Agents/Scripts/CoreBrainInternal.cs:244) Brain.DecideAction () (at Assets/ML-Agents/Scripts/Brain.cs:308) Academy.DecideAction () (at Assets/ML-Agents/Scripts/Academy.cs:250) Academy.RunMdp () (a

not sure why this has a -1 value, I've stopped training prematurely on the Ball3D demo without any problems, anyone have any ideas?

@vincentpierre
Copy link
Contributor

Hi, Thank you for you question. It seems to me that you forgot to add a custom placeholder in your Internal Brain. In Embedding the trained model itself it says you need to add a float placeholder called epsilon with values ranging from 0 to 0.
The inspector image here might help.

@awjuliani
Copy link
Contributor

Please let us know if you are able to get the epsilon parameter to work for you to run the agent natively.

@sterlingcrispin
Copy link
Contributor Author

Ah yep sure enough that's the problem. I remember setting that on the Ball3Ddemo but overlooked it on my own scene, it would be awesome if there was a warning about that built in

@codmw44
Copy link

codmw44 commented Sep 27, 2017

I have similar issues with "Shape [-1,24] has negative dimensions", and after set "graph placeholders" like in Ball3D I get from unity console this error: TFException: Attempting to use uninitialized value dense/kernel
[[Node: dense/kernel/read = IdentityT=DT_FLOAT, _class=["loc:@dense/kernel"], _device="/job:localhost/replica:0/task:0/cpu:0"]]
TensorFlow.TFStatus.CheckMaybeRaise (TensorFlow.TFStatus incomingStatus, System.Boolean last) (at <6ed6db22f8874deba74ffe3e566039be>:0)
TensorFlow.TFSession.Run (TensorFlow.TFOutput[] inputs, TensorFlow.TFTensor[] inputValues, TensorFlow.TFOutput[] outputs, TensorFlow.TFOperation[] targetOpers, TensorFlow.TFBuffer runMetadata, TensorFlow.TFBuffer runOptions, TensorFlow.TFStatus status) (at <6ed6db22f8874deba74ffe3e566039be>:0)
TensorFlow.TFSession+Runner.Run (TensorFlow.TFStatus status) (at <6ed6db22f8874deba74ffe3e566039be>:0)
CoreBrainInternal.DecideAction () (at Assets/ML-Agents/Scripts/CoreBrainInternal.cs:244)
Brain.DecideAction () (at Assets/ML-Agents/Scripts/Brain.cs:308)
Academy.DecideAction () (at Assets/ML-Agents/Scripts/Academy.cs:250)
Academy.RunMdp () (at Assets/ML-Agents/Scripts/Academy.cs:337)
Academy.FixedUpdate () (at Assets/ML-Agents/Scripts/Academy.cs:260)

Maybe I make mistakes in get Graph Model after learning?
image

@lock
Copy link

lock bot commented Jan 4, 2020

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants