From ba8ef6e957ed14185fcaa130c77867ee2e08d4bd Mon Sep 17 00:00:00 2001 From: Austin <504977925@qq.com> Date: Thu, 10 Oct 2024 19:26:37 +0800 Subject: [PATCH 1/2] fix numpy has no attribute 'bool8' --- gym/utils/passive_env_checker.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gym/utils/passive_env_checker.py b/gym/utils/passive_env_checker.py index bd826510f48..1a6618a5ab9 100644 --- a/gym/utils/passive_env_checker.py +++ b/gym/utils/passive_env_checker.py @@ -222,7 +222,7 @@ def env_step_passive_checker(env, action): ) obs, reward, done, info = result - if not isinstance(done, (bool, np.bool8)): + if not isinstance(done, (bool, np.bool)): logger.warn( f"Expects `done` signal to be a boolean, actual type: {type(done)}" ) @@ -230,11 +230,11 @@ def env_step_passive_checker(env, action): obs, reward, terminated, truncated, info = result # np.bool is actual python bool not np boolean type, therefore bool_ or bool8 - if not isinstance(terminated, (bool, np.bool8)): + if not isinstance(terminated, (bool, np.bool)): logger.warn( f"Expects `terminated` signal to be a boolean, actual type: {type(terminated)}" ) - if not isinstance(truncated, (bool, np.bool8)): + if not isinstance(truncated, (bool, np.bool)): logger.warn( f"Expects `truncated` signal to be a boolean, actual type: {type(truncated)}" ) From f9a2c9a86df808eeb38d37744e8249dabd91734b Mon Sep 17 00:00:00 2001 From: Austin <504977925@qq.com> Date: Wed, 16 Oct 2024 18:30:58 +0800 Subject: [PATCH 2/2] fix numpy has no attribute bool8 --- gym/utils/passive_env_checker.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gym/utils/passive_env_checker.py b/gym/utils/passive_env_checker.py index 1a6618a5ab9..ef03e5b336d 100644 --- a/gym/utils/passive_env_checker.py +++ b/gym/utils/passive_env_checker.py @@ -222,7 +222,7 @@ def env_step_passive_checker(env, action): ) obs, reward, done, info = result - if not isinstance(done, (bool, np.bool)): + if not isinstance(done, (bool, np.bool_)): logger.warn( f"Expects `done` signal to be a boolean, actual type: {type(done)}" ) @@ -230,11 +230,11 @@ def env_step_passive_checker(env, action): obs, reward, terminated, truncated, info = result # np.bool is actual python bool not np boolean type, therefore bool_ or bool8 - if not isinstance(terminated, (bool, np.bool)): + if not isinstance(terminated, (bool, np.bool_)): logger.warn( f"Expects `terminated` signal to be a boolean, actual type: {type(terminated)}" ) - if not isinstance(truncated, (bool, np.bool)): + if not isinstance(truncated, (bool, np.bool_)): logger.warn( f"Expects `truncated` signal to be a boolean, actual type: {type(truncated)}" )