You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/home/zhr/zhr/skrl/docs/source/examples/deepmind/dm_manipulation_stack_sac.py", line 179, in <module>
trainer = SequentialTrainer(cfg=cfg_trainer, env=env, agents=agent_sac)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zhr/zhr/skrl/skrl/trainers/torch/sequential.py", line 55, in __init__
self.agents.init(trainer_cfg=self.cfg)
File "/home/zhr/zhr/skrl/skrl/agents/torch/sac/sac.py", line 201, in init
self.memory.create_tensor(name="states", size=self.observation_space, dtype=torch.float32)
File "/home/zhr/zhr/skrl/skrl/memories/torch/base.py", line 197, in create_tensor
size = self._get_space_size(size, keep_dimensions)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zhr/zhr/skrl/skrl/memories/torch/base.py", line 111, in _get_space_size
raise ValueError("keep_dimensions=True cannot be used with Dict spaces")
ValueError: keep_dimensions=True cannot be used with Dict spaces
The reason was that I used the 'dict' type as the obs space.
I am facing the same issues. It does not seem like the Memory class handels dict observations. One work around is to concatenate the observations instead.
In addition, spaces utilities were added to develop branch to handle fundamental (Box, Discrete and MultiDiscrete) and composite (Tuple and Dict) spaces better.
Please, use the develop branch while the new release is being completed
Description
Hello, when I run the example files provided by the [official document] (https://github.com/Toni-SM/skrl/blob/main/docs/source/examples/deepmind/dm_manipulation_stack_sac.py), an error comes as follows.
The reason was that I used the 'dict' type as the obs space.
I noticed that a similar error was mentioned in https://github.com/Toni-SM/skrl/pull/201. Do you have any temporary solutions for using 'dict' obs space, thanks.
What skrl version are you using?
1.3.0
What ML framework/library version are you using?
Pytorch version
Additional system information
Python 3.10, Ubuntu20.04
The text was updated successfully, but these errors were encountered: