mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-05-28 22:56:53 +00:00
parent
57e8b97df5
commit
dba0baa491
3 changed files with 4 additions and 4 deletions
|
|
@ -181,7 +181,7 @@ def json_to_data(json_string: str, custom_objects: Optional[dict[str, Any]] = No
|
|||
@functools.singledispatch
|
||||
def open_path(
|
||||
path: Union[str, pathlib.Path, io.BufferedIOBase], mode: str, verbose: int = 0, suffix: Optional[str] = None
|
||||
) -> Union[io.BufferedWriter, io.BufferedReader, io.BytesIO]:
|
||||
) -> Union[io.BufferedWriter, io.BufferedReader, io.BytesIO, io.BufferedRandom]:
|
||||
"""
|
||||
Opens a path for reading or writing with a preferred suffix and raises debug information.
|
||||
If the provided path is a derivative of io.BufferedIOBase it ensures that the file
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ class VecNormalize(VecEnvWrapper):
|
|||
assert self.norm_obs_keys is not None
|
||||
# Only normalize the specified keys
|
||||
for key in self.norm_obs_keys:
|
||||
obs_[key] = self._normalize_obs(obs[key], self.obs_rms[key]).astype(np.float32)
|
||||
obs_[key] = self._normalize_obs(obs[key], self.obs_rms[key]).astype(np.float32) # type: ignore[call-overload]
|
||||
else:
|
||||
assert isinstance(self.obs_rms, RunningMeanStd)
|
||||
obs_ = self._normalize_obs(obs, self.obs_rms).astype(np.float32)
|
||||
|
|
@ -265,7 +265,7 @@ class VecNormalize(VecEnvWrapper):
|
|||
if isinstance(obs, dict) and isinstance(self.obs_rms, dict):
|
||||
assert self.norm_obs_keys is not None
|
||||
for key in self.norm_obs_keys:
|
||||
obs_[key] = self._unnormalize_obs(obs[key], self.obs_rms[key])
|
||||
obs_[key] = self._unnormalize_obs(obs[key], self.obs_rms[key]) # type: ignore[call-overload]
|
||||
else:
|
||||
assert isinstance(self.obs_rms, RunningMeanStd)
|
||||
obs_ = self._unnormalize_obs(obs, self.obs_rms)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ from stable_baselines3.common.monitor import Monitor
|
|||
from stable_baselines3.common.vec_env import DummyVecEnv, SubprocVecEnv, VecFrameStack, VecNormalize, VecVideoRecorder
|
||||
|
||||
try:
|
||||
import moviepy
|
||||
import moviepy # noqa: F401
|
||||
|
||||
have_moviepy = True
|
||||
except ImportError:
|
||||
|
|
|
|||
Loading…
Reference in a new issue