diff --git a/docs/misc/changelog.rst b/docs/misc/changelog.rst index 38acce9..49dc5dc 100644 --- a/docs/misc/changelog.rst +++ b/docs/misc/changelog.rst @@ -37,6 +37,7 @@ Others: - Split the ``collect_rollout()`` method for off-policy algorithms - Added ``_on_step()`` for off-policy base class - Optimized replay buffer size by removing the need of ``next_observations`` numpy array +- Ignored errors from newer pytype version Documentation: ^^^^^^^^^^^^^^ diff --git a/stable_baselines3/common/base_class.py b/stable_baselines3/common/base_class.py index 4e51367..e2e8d98 100644 --- a/stable_baselines3/common/base_class.py +++ b/stable_baselines3/common/base_class.py @@ -330,7 +330,8 @@ class BaseAlgorithm(ABC): env = data["env"] # noinspection PyArgumentList - model = cls(policy=data["policy_class"], env=env, device='auto', _init_setup_model=False) + model = cls(policy=data["policy_class"], env=env, + device='auto', _init_setup_model=False) # pytype: disable=not-instantiable,wrong-keyword-args # load parameters model.__dict__.update(data) @@ -350,7 +351,7 @@ class BaseAlgorithm(ABC): # Sample gSDE exploration matrix, so it uses the right device # see issue #44 if model.use_sde: - model.policy.reset_noise() + model.policy.reset_noise() # pytype: disable=attribute-error return model def set_random_seed(self, seed: Optional[int] = None) -> None: diff --git a/stable_baselines3/common/policies.py b/stable_baselines3/common/policies.py index bc387c2..276a0f3 100644 --- a/stable_baselines3/common/policies.py +++ b/stable_baselines3/common/policies.py @@ -126,7 +126,7 @@ class BaseModel(nn.Module, ABC): device = get_device(device) saved_variables = th.load(path, map_location=device) # Create policy object - model = cls(**saved_variables['data']) + model = cls(**saved_variables['data']) # pytype: disable=not-instantiable # Load weights model.load_state_dict(saved_variables['state_dict']) model.to(device)