- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 62
Open
Description
Describe the bug
Calling recover_environment() on the 'mujoco/humanoidstandup/medium-v0' dataset raises a ValueError related to the Monitor wrapper not inheriting from gymnasium.utils.RecordConstructorArgs. This prevents the environment from being recreated.
Code example
import minari
dataset = minari.load_dataset('mujoco/humanoidstandup/medium-v0', download=True)
test_env = dataset.recover_environment()Stack trace
Traceback (most recent call last):
  File "/home/lorenzobonanni/PycharmProjects/PythonProject/file.py", line 5, in <module>
    test_env = dataset.recover_environment()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lorenzobonanni/miniconda3/envs/PythonProject/lib/python3.12/site-packages/minari/dataset/minari_dataset.py", line 219, in recover_environment
    return gym.make(self.env_spec, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lorenzobonanni/miniconda3/envs/PythonProject/lib/python3.12/site-packages/gymnasium/envs/registration.py", line 820, in make
    raise ValueError(
ValueError: Monitor wrapper does not inherit from `gymnasium.utils.RecordConstructorArgs`, therefore, the wrapper cannot be recreated.
System Info
- Minari install method: pip install "minari[all]"
- Operating system: Ubuntu 22.04.4 LTS
- Python version: 3.12.11 (conda)
- Minari version: 0.5.3
- MuJoCo version: 3.2.3
- Gymnasium version: 1.1.1
- Pillow version: 11.2.1
Additional context
I found a workaround: before calling recover_environment(), I set dataset.env_spec.additional_wrappers = (), which avoids the error.
import minari
dataset = minari.load_dataset('mujoco/humanoidstandup/medium-v0', download=True)
# Workaround to avoid the error
dataset.env_spec.additional_wrappers = ()
test_env = dataset.recover_environment()Metadata
Metadata
Assignees
Labels
No labels