From d3c17c50bf111a91bb2cdf4977d5fb3aaef8a415 Mon Sep 17 00:00:00 2001 From: MentalGear Date: Thu, 27 Feb 2020 19:48:42 +0100 Subject: [PATCH] Check Action Type https://github.com/hill-a/stable-baselines/issues/707 --- stable_baselines/common/vec_env/base_vec_env.py | 1 + 1 file changed, 1 insertion(+) diff --git a/stable_baselines/common/vec_env/base_vec_env.py b/stable_baselines/common/vec_env/base_vec_env.py index 189416e52c..4ebb438aa5 100644 --- a/stable_baselines/common/vec_env/base_vec_env.py +++ b/stable_baselines/common/vec_env/base_vec_env.py @@ -146,6 +146,7 @@ def step(self, actions): :param actions: ([int] or [float]) the action :return: ([int] or [float], [float], [bool], dict) observation, reward, done, information """ + assert isinstance( actions, ( list, np.ndarray ) ), "Action must be of type list or np.ndarray. Try wrapping your action variable in a list [ ] to fix this issue." self.step_async(actions) return self.step_wait()