mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-09-15 22:10:25 +00:00
Avoid double wrapping
This commit is contained in:
parent
f38ddcb278
commit
02b452a9f9
2 changed files with 2 additions and 2 deletions
|
|
@ -141,7 +141,7 @@ class BaseRLModel(ABC):
|
|||
print("Wrapping the env in a DummyVecEnv.")
|
||||
env = DummyVecEnv([lambda: env])
|
||||
|
||||
if is_image_space(env.observation_space):
|
||||
if is_image_space(env.observation_space) and not isinstance(env, VecTransposeImage):
|
||||
if self.verbose >= 1:
|
||||
print("Wrapping the env in a VecTransposeImage.")
|
||||
env = VecTransposeImage(env)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ def is_image_space(observation_space: spaces.Space,
|
|||
:param observation_space: (spaces.Space)
|
||||
:param channels_last: (bool)
|
||||
:param check_channels: (bool) Whether to do or not the check for the number of channels.
|
||||
Because of frame-skip, the observation space may have more channels than expected.
|
||||
e.g., with frame-stacking, the observation space may have more channels than expected.
|
||||
:return: (bool)
|
||||
"""
|
||||
if isinstance(observation_space, spaces.Box) and len(observation_space.shape) == 3:
|
||||
|
|
|
|||
Loading…
Reference in a new issue