-
Notifications
You must be signed in to change notification settings - Fork 729
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
ValueError: actor_network output spec does not match action spec #548
Comments
Hi, sorry you are having issues running ppo training. When you say "training is working" do you mean it trains to the expected value? Can you dig into the network/action spec mismatch a bit more to see why the output layer spec doesn't match the action_spec? Looks like the shape is mismatched (() vs (1,)) |
Hi and thanks for helping! First, my action specs defined in my env are: When I say "training is working", I mean training starts without error, with logits outputs from the actor model having the good shape (i.e.:
What is this I am pretty new to tf-agents so I am probably wrong somewhere. Edit: It was my bad, I solved my issue by changing my action shape, from |
I'm having the same issue. In my case, my action_spec is not an integer. Instead, each action is represented by an array with two entries: |
@cedavidyang I responded in #656 let's follow up there. |
Hello,
I am trying to train a PPO agent with the default
actor_distribution_network
but I get this error:In my Python env, I have:
self._action_spec = BoundedArraySpec((1,), dtype=np.int64, name="action", minimum=0, maximum=126)
. Then I wrap my Python env in aTFPyEnvironment
.Note that training is working when I comment the following lines in
tf_agents.agents.ppo.ppo_policy.py
:Does anyone have an idea to fix the error above?
Thanks!
Versions:
The text was updated successfully, but these errors were encountered: