-
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
Dimension error in PPO train() with multiple actions #212
Comments
Can you share the full specs from your environment? Also please run the environment validation to make sure your environment consistently generates data fitting the specs: https://github.com/tensorflow/agents/blob/master/tf_agents/environments/utils.py#L45 |
Yes, both the observation and actions specs are multidimensional:
This code snippet yields the following output:
|
Some extra information: the error can be traced back to line 586 in ppo_agent.py:
If I switch to the Reinforce algorithm, my agent does run, but training is slow |
I'm trying to train a PPO agent in an environment with a multi-dimensional action space, specifically, a 1x5 vector (floats in [0,10]), a 1x10 vector (floats in [0,10]) and an boolean (integer with min=0,max=1). I'm able to create an agent but during training, I receive this error:
InvalidArgumentError: Dimension 2 in both shapes must be equal, but are 5 and 1. Shapes are [1,450,5,1] and [1,450,1,1].
From merging shape 1 with other shapes. for 'epoch_0/AddN_1' (op: 'AddN') with input shapes: [1,450,10,1], [1,450,5,1], [1,450,1,1].
I've been able to trace back the error to happen within the function tf_agent.train(). Relevant code is here
The text was updated successfully, but these errors were encountered: