Closed wilhem closed 1 day ago
I forgot to add the output of check_env()
Traceback (most recent call last):
File "/home/ubuntu/workspace/src/simulator/webots/controllers/supervisor_controller/supervisor_controller.py", line 383, in <module>
main()
File "/home/ubuntu/workspace/src/simulator/webots/controllers/supervisor_controller/supervisor_controller.py", line 319, in main
print(check_env(env))
File "/home/ubuntu/Downloads/deepbots-env/lib/python3.10/site-packages/stable_baselines3/common/env_checker.py", line 421, in check_env
assert isinstance(
AssertionError: Your environment must inherit from the gymnasium.Env class cf. https://gymnasium.farama.org/api/env/
My custom environement has the following structure:
File 1:
import gym
from controller import Supervisor
class DeepbotsSupervisorEnv(Supervisor, gym.Env):
File 2:
from deepbots.supervisor.controllers.deepbots_supervisor_env import DeepbotsSupervisorEnv
class RobotSupervisorEnv(DeepbotsSupervisorEnv):
File 3:
from deepbots.supervisor.controllers.robot_supervisor_env import RobotSupervisorEnv
class MyEnv(RobotSupervisorEnv):
env = MyEnv()
So gym.Env
should be seen by the checker. Or not?
(I removed all the constructor code form the examples)
Hey, gym isn't gymnasium. First thing to do is the migration. Check https://gymnasium.farama.org/content/migration-guide/
What do you mean? Is your environment integrated with gymnasium now?
Not yet
duplicate of https://github.com/DLR-RM/stable-baselines3/issues/1959 ?
Yes
🐛 Bug
I'm trying to use SAC + HER (both from SB3) with a custom environment.
My environment has the following observation and space definitions:
and, as written here, I defined the following methods:
The problem is that running the following code:
gives me the following error:
Interestingly I found another user with a similar problem here: link. Running his minimal code leads to the following error:
What should I do? Where does the size of tensor (14) comes from? 64 is the batch size, but 14?
Code example
Relevant log output / Error message