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
Depending on the type of seed, the subspaces will be seeded differently
54
54
55
55
* ``None`` - All the subspaces will use a random initial seed
56
56
* ``Int`` - The integer is used to seed the :class:`Tuple` space that is used to generate seed values for each of the subspaces. Warning, this does not guarantee unique seeds for all the subspaces.
57
-
* ``List`` - Values used to seed the subspaces. This allows the seeding of multiple composite subspaces ``[42, 54, ...]``.
57
+
* ``List`` / ``Tuple`` - Values used to seed the subspaces. This allows the seeding of multiple composite subspaces ``[42, 54, ...]``.
58
58
59
59
Args:
60
60
seed: An optional list of ints or int to seed the (sub-)spaces.
f"Invalid `observation_mode`, expected: 'same' or 'different' or tuple of single and batch observation space, actual got {observation_mode}"
173
+
)
174
+
150
175
dummy_env.close()
151
176
deldummy_env
152
177
@@ -162,9 +187,7 @@ def __init__(
162
187
)
163
188
exceptCustomSpaceErrorase:
164
189
raiseValueError(
165
-
"Using `shared_memory=True` in `AsyncVectorEnv` is incompatible with non-standard Gymnasium observation spaces (i.e. custom spaces inheriting from `gymnasium.Space`), "
166
-
"and is only compatible with default Gymnasium spaces (e.g. `Box`, `Tuple`, `Dict`) for batching. "
167
-
"Set `shared_memory=False` if you use custom observation spaces."
190
+
"Using `AsyncVector(..., shared_memory=True)` caused an error, you can disable this feature with `shared_memory=False` however this is slower."
f"Some environments have an observation space different from `{self.single_observation_space}`. "
606
-
"In order to batch observations, the observation spaces from all environments must be equal."
607
-
)
635
+
ifself.observation_mode=="same":
636
+
raiseRuntimeError(
637
+
"AsyncVectorEnv(..., observation_mode='same') however some of the sub-environments observation spaces are not equivalent. If this is intentional, use `observation_mode='different'` instead."
638
+
)
639
+
else:
640
+
raiseRuntimeError(
641
+
"AsyncVectorEnv(..., observation_mode='different' or custom space) however the sub-environment's observation spaces do not share a common shape and dtype."
642
+
)
643
+
608
644
ifnotall(same_action_spaces):
609
645
raiseRuntimeError(
610
646
f"Some environments have an action space different from `{self.single_action_space}`. "
0 commit comments