mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-07-04 04:07:27 +00:00
Fix sync_envs_normalization
This commit is contained in:
parent
ef07165bd4
commit
f1bba678e1
1 changed files with 2 additions and 0 deletions
|
|
@ -67,7 +67,9 @@ def sync_envs_normalization(env: "GymEnv", eval_env: "GymEnv") -> None:
|
|||
"""
|
||||
env_tmp, eval_env_tmp = env, eval_env
|
||||
while isinstance(env_tmp, VecEnvWrapper):
|
||||
assert isinstance(eval_env_tmp, VecEnvWrapper) # Ensure that env and eval_env are similarly wrapped.
|
||||
if isinstance(env_tmp, VecNormalize):
|
||||
assert isinstance(eval_env_tmp, VecNormalize) # Ensure that env and eval_env are similarly wrapped.
|
||||
# Only synchronize if observation normalization exists
|
||||
if hasattr(env_tmp, "obs_rms"):
|
||||
eval_env_tmp.obs_rms = deepcopy(env_tmp.obs_rms)
|
||||
|
|
|
|||
Loading…
Reference in a new issue