Skip to content

envs = Gymnasium2Torch(envs, device) error #28

Description

@hyfqphy

when i run [0 quick_start.ipynb]: An error occurred in envs = Gymnasium2Torch(envs, device)`

`---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
Cell In[13], line 8
6 envs = gym.vector.AsyncVectorEnv([FakeAtari for _ in range(n_envs)])
7 # wrap the environments to convert the observations to torch tensors
----> 8 envs = Gymnasium2Torch(envs, device)
9 # create the intrinsic reward module
10 irs = ICM(envs, device)

File /opt/anaconda3/envs/rllte/lib/python3.8/site-packages/rllte/env/utils.py:128, in Gymnasium2Torch.init(self, env, device, envpool)
127 def init(self, env: VectorEnv, device: str, envpool: bool = False) -> None:
--> 128 super().init(env)
129 self.num_envs = env.unwrapped.num_envs
130 self.device = th.device(device)

File /opt/anaconda3/envs/rllte/lib/python3.8/site-packages/gymnasium/core.py:310, in Wrapper.init(self, env)
304 """Wraps an environment to allow a modular transformation of the :meth:step and :meth:reset methods.
305
306 Args:
307 env: The environment to wrap
308 """
309 self.env = env
--> 310 assert isinstance(env, Env)
312 self._action_space: spaces.Space[WrapperActType] | None = None
313 self._observation_space: spaces.Space[WrapperObsType] | None = None

AssertionError:`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions