From cc88c8e4c0de9183bcd544223b88168118139e5b Mon Sep 17 00:00:00 2001 From: Oleg Klimov Date: Mon, 18 Mar 2019 10:58:23 -0700 Subject: [PATCH] remove tensorflow dependency from VecEnv --- baselines/common/vec_env/vec_normalize.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/baselines/common/vec_env/vec_normalize.py b/baselines/common/vec_env/vec_normalize.py index f3255e9..1842330 100644 --- a/baselines/common/vec_env/vec_normalize.py +++ b/baselines/common/vec_env/vec_normalize.py @@ -1,8 +1,6 @@ from . import VecEnvWrapper -from baselines.common.running_mean_std import RunningMeanStd import numpy as np - class VecNormalize(VecEnvWrapper): """ A vectorized wrapper that normalizes the observations @@ -11,6 +9,7 @@ class VecNormalize(VecEnvWrapper): def __init__(self, venv, ob=True, ret=True, clipob=10., cliprew=10., gamma=0.99, epsilon=1e-8): VecEnvWrapper.__init__(self, venv) + from baselines.common.running_mean_std import RunningMeanStd self.ob_rms = RunningMeanStd(shape=self.observation_space.shape) if ob else None self.ret_rms = RunningMeanStd(shape=()) if ret else None self.clipob = clipob