-
Notifications
You must be signed in to change notification settings - Fork 728
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
DQN loss calculation error when using Dict Action space #297
Comments
Thanks for raising this. I think it is a bug. agents/tf_agents/agents/dqn/dqn_agent.py Line 519 in 9057dd6
has to be changed to something like: agents/tf_agents/agents/dqn/dqn_agent.py Line 552 in 9057dd6
Would you like to submit a PR? |
@kbanoop, I applied your suggested fix and it seem to work fine. agents/tf_agents/agents/dqn/dqn_agent.py Lines 520 to 523 in 9057dd6
this is the this is what i get now:
|
Yes that sounds like the same issue. Can you try adding actions = tf.nest.flatten(actions)[0], perhaps at the beginning of the _compute_q_values function? |
followup issue to #276
as I mentioned in the previous issue, the action space is of type
gym.spaces.Dict
.following the DQN tutorial I reached the point for the agent to calculate the loss.
but I get an error that the action space is missing the shape attribute.
tracing the code back to the
gym_wrapper.py
it seems that dict space doesn't have shape attributethis is the original error:
how can I resolve this?
The text was updated successfully, but these errors were encountered: