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
I have been using skrl with OIGE, but when I try the "Getting Started" code for dm_control :
# import the environment wrapper and the deepmind suite
from skrl.envs.wrappers.torch import wrap_env
from dm_control import suite
# load the environment
env = suite.load(domain_name="cartpole", task_name="swingup")
# wrap the environment
env = wrap_env(env) # or 'env = wrap_env(env, wrapper="dm")'
I get the following error:
[skrl:INFO] Environment class: dm_env._environment.Environment
INFO:skrl:Environment class: dm_env._environment.Environment
[skrl:INFO] Environment wrapper: DeepMind
INFO:skrl:Environment wrapper: DeepMind
Traceback (most recent call last):
File "/home/elle/code/envs/sk_test/lib/python3.10/site-packages/skrl/envs/wrappers/torch/base.py", line 24, in __init__
self._action_space = self._env.single_action_space
AttributeError: 'Environment' object has no attribute 'single_action_space'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/elle/code/devel/skrl_play/test123.py", line 9, in <module>
env = wrap_env(env) # or 'env = wrap_env(env, wrapper="dm")'
File "/home/elle/code/envs/sk_test/lib/python3.10/site-packages/skrl/envs/wrappers/torch/__init__.py", line 103, in wrap_env
return DeepMindWrapper(env)
File "/home/elle/code/envs/sk_test/lib/python3.10/site-packages/skrl/envs/wrappers/torch/deepmind_envs.py", line 19, in __init__
super().__init__(env)
File "/home/elle/code/envs/sk_test/lib/python3.10/site-packages/skrl/envs/wrappers/torch/base.py", line 27, in __init__
self._action_space = self._env.action_space
AttributeError: 'Environment' object has no attribute 'action_space'. Did you mean: 'action_spec'?
This is with Python 3.10.14, dm_control==1.0.20 and skrl==1.1.0. It seems that in the inheritance of DeepMindWrapper from in the base Wrapper class, self._env.action_space is being called before self._spec_to_space can happen.
Also just as a heads up, when I try with skrl==1.2.0, I now get this:
Traceback (most recent call last):
File "/home/elle/code/devel/skrl_play/test123.py", line 9, in <module>
env = wrap_env(env) # or 'env = wrap_env(env, wrapper="dm")'
File "/home/elle/code/envs/sk_test/lib/python3.10/site-packages/skrl/envs/wrappers/torch/__init__.py", line 154, in wrap_env
raise ValueError(f"Unknown wrapper type: {wrapper}")
ValueError: Unknown wrapper type: ['dm_env._environment.Environment']
Thank you!
What skrl version are you using?
1.1.0
What ML framework/library version are you using?
torch==2.3.1
Additional system information
Python 3.10.14
The text was updated successfully, but these errors were encountered:
Yes, in latest release (version 1.2.0) the automatic detection of the environment to be wrapped was updated and it didn't include DeepMind envs.
Regarding the AttributeError error when wrapping the DeepMind environment, the DeepMind wrapper is not maintained anymore and will be removed in next version in favor of Shimmy. See skrl's Shimmy examples for training using a DeepMind environment.
Description
Hi there,
I have been using
skrl
with OIGE, but when I try the "Getting Started" code fordm_control
:I get the following error:
This is with Python 3.10.14,
dm_control==1.0.20
andskrl==1.1.0
. It seems that in the inheritance ofDeepMindWrapper
from in the baseWrapper
class,self._env.action_space
is being called beforeself._spec_to_space
can happen.Also just as a heads up, when I try with
skrl==1.2.0
, I now get this:Thank you!
What skrl version are you using?
1.1.0
What ML framework/library version are you using?
torch==2.3.1
Additional system information
Python 3.10.14
The text was updated successfully, but these errors were encountered: