You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ValueError: The two structures don't have the same nested structure.
...
More specifically: The two structures don't have the same number of elements.
...
during compute_single_action() (see script). To my understanding it is happening during mapping incoming observation to one sampled from the observation space. My observation space has a Repeated subspace.
As I can see, Sampling from Repeated space produces a list with random length.
Mapping uses tree.assert_same_structure method which raises error when:
If the two structures do not have the same number of elements or if the two structures are not nested in the same way.
It seems, that randomizing number of elements when sampling from Repeated is incorrect behaviour in this case as it will definitely not have the same number of elements with real observation, therefore this method will most likely raise an error, although I can be wrong.
The text was updated successfully, but these errors were encountered:
Misterion777
added
bug
Something that is supposed to be working; but isn't
triage
Needs triage (eg: priority, bug/not-bug, and owning component)
labels
Jun 15, 2022
Hi @Misterion777 the reason for this issue is that in your script the example_obs does not match the structure specified by the space of your environment. To test that this is really the case you can use env.observation_space.sample() or env.reset() to get a proper obs struct and then your script would work.
What happened + What you expected to happen
Hi, I’m encountering following error:
during
compute_single_action()
(see script). To my understanding it is happening during mapping incoming observation to one sampled from the observation space. My observation space has a Repeated subspace.As I can see, Sampling from Repeated space produces a list with random length.
Mapping uses tree.assert_same_structure method which raises error when:
It seems, that randomizing number of elements when sampling from Repeated is incorrect behaviour in this case as it will definitely not have the same number of elements with real observation, therefore this method will most likely raise an error, although I can be wrong.
Versions / Dependencies
Python: 3.8.12
Ray: 1.13.0
Torch: 1.11.0
OS: MacOS
Reproduction script
Issue Severity
High: It blocks me from completing my task.
The text was updated successfully, but these errors were encountered: