I would like to use mulitple observations in my scene, which I am unable to get working properly. I then tried it in the grid world (duplicated the agent cam and assigned it to the agent). I also added it to the camera resolutions list. When I start training I get TensorFlow shape errors :
Caused by op 'concat', defined at:
File "ppo.py", line 83, in <module>
normalize=normalize, num_layers=num_layers)
File "/Users/gerard/Git/ml-agents/python/ppo/models.py", line 27, in create_agent_model
return DiscreteControlModel(lr, brain, h_size, epsilon, beta, max_step, normalize, num_layers)
File "/Users/gerard/Git/ml-agents/python/ppo/models.py", line 297, in __init__
hidden = tf.concat([hidden_visual, hidden_state], axis=1)
File "/Users/gerard/.virtualenvs/boatml/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1066, in concat
name=name)
File "/Users/gerard/.virtualenvs/boatml/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 493, in _concat_v2
name=name)
File "/Users/gerard/.virtualenvs/boatml/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 767, in apply_op
op_def=op_def)
File "/Users/gerard/.virtualenvs/boatml/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2630, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/Users/gerard/.virtualenvs/boatml/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1204, in __init__
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
InvalidArgumentError (see above for traceback): ConcatOp : Dimensions of inputs should match: shape[0] = [2,64] vs. shape[1] = [1,64]
[[Node: concat = ConcatV2[N=2, T=DT_FLOAT, Tidx=DT_INT32, _device="/job:localhost/replica:0/task:0/cpu:0"](dense_2/Elu, dense_4/Elu, concat/axis)]]
I checked the examples, none of them actually use multiple observations. Is there a working example elsewhere?
The ppo code does not support multiple observations at this time. This would be a good idea for a feature!
Hi @gerardsimons,
@asolano recently made a pull request with initial support for multiple observations and it has been merged to master branch. The concat issue was resolved by handling each observation separately and merging all the streams in the first dense layer. Could you please try this implementation with your project and let us know if you face any problems. Thanks!
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.
Most helpful comment
Hi @gerardsimons,
@asolano recently made a pull request with initial support for multiple observations and it has been merged to master branch. The concat issue was resolved by handling each observation separately and merging all the streams in the first dense layer. Could you please try this implementation with your project and let us know if you face any problems. Thanks!