Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assertionerror, observation space , vectransposeimage #1185

Open
skgr07 opened this issue Jul 26, 2023 · 0 comments
Open

assertionerror, observation space , vectransposeimage #1185

skgr07 opened this issue Jul 26, 2023 · 0 comments

Comments

@skgr07
Copy link

skgr07 commented Jul 26, 2023

Important Note: We do not do technical support, nor consulting and don't answer personal questions per email.

If you have any questions, feel free to create an issue with the tag [question].
If you wish to suggest an enhancement or feature request, add the tag [feature request].
If you are submitting a bug report, please fill in the following details.

If your issue is related to a custom gym environment, please check it first using:

from stable_baselines.common.env_checker import check_env
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\stable_baselines3\common\env_checker.py", line 390, in check_env
    assert isinstance(
AssertionError: Your environment must inherit from the gymnasium.Env class cf. https://gymnasium.farama.org/api/env/

Describe the bug
I tried to use vectranspose image wrapper, but it returned an error. I think this is a problem of my developing environment, but I cannot specify where the problem is.
And I don't know how to inherit from gymnasium env class. is there anyone who can explain?
Code example
Please try to provide a minimal example to reproduce the bug. Error messages and stack traces are also helpful.

Please use the markdown code blocks
for both code and stack traces.

from stable_baselines3 import DQN, A2C, DDPG
from stable_baselines3.common.env_checker import check_env
from stable_baselines3.common.monitor import Monitor
from stable_baselines3.common.vec_env import DummyVecEnv, VecTransposeImage
from stable_baselines3.common.evaluation import evaluate_policy
from stable_baselines3.common.callbacks import EvalCallback
from stable_baselines3.common.noise import NormalActionNoise, OrnsteinUhlenbeckActionNoise
Traceback (most recent call last): File ...
  File "d:\AirSim\End-to-end_Autonomous_Driving_Car_Simulation-main\PythonClient_working\car\reinforcement_learning\rl_car.py", line 37, in <module>
    check_env(env)
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\stable_baselines3\common\env_checker.py", line 390, in check_env
    assert isinstance(
AssertionError: Your environment must inherit from the gymnasium.Env class cf. https://gymnasium.farama.org/api/env/

System Info
installed by pip, stable baselines 3 and sb3 contrib by git clone
python3.11.4
gym==0.26.2
gym-notices==0.0.8
gymnasium==0.28.1
numpy==1.24.3
oauthlib==3.2.2
opencv-contrib-python==4.8.0.74
sb3-contrib @ git+https://github.com/Stable-Baselines-Team/stable-baselines3-contrib@35f06254ba3a470e8bbe1dff0bfc6f319ee2431a
scipy==1.11.1
Shimmy==0.2.1
stable-baselines3 @ git+https://github.com/DLR-RM/stable-baselines3@ba77dd7c6180c0ec9a47dfa98291c2103e6750df
sympy==1.12
tensorboard==2.13.0
tensorboard-data-server==0.7.1
tensorflow==2.13.0
tensorflow-estimator==2.13.0
tensorflow-intel==2.13.0
tensorflow-io-gcs-filesystem==0.31.0

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant