sail-sg / envpool

C++-based high-performance parallel environment execution engine (vectorized env) for general RL environments.
https://envpool.readthedocs.io
Apache License 2.0
1.08k stars 99 forks source link

[BUG] Error running mujoco-gym tasks with the parameter xml_file #295

Open dynamicDr opened 7 months ago

dynamicDr commented 7 months ago

An error occur using envpool 0.8.4 to run mujoco-gym tasks with the parameter xml_file (I referred to https://www.gymlibrary.dev/environments/mujoco/ant/ for this parameter).

The following code runs successfully:

env = envpool.make("Ant-v4", env_type="gym", num_envs=100, healthy_reward=1)

However, when I run the following code (with the parameter xml_file):

env = envpool.make("Ant-v4", env_type="gym", num_envs=100, xml_file="ant.xml")

I encounter the following error: Traceback (most recent call last): File "/tianshou/mytest/envpool_test_2.py", line 11, in env = envpool.make("Ant-v4", env_type="gym", num_envs=100, xml_file="ant.xml") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/envs/tianshou/lib/python3.11/site-packages/envpool/registration.py", line 65, in make spec = self.make_spec(task_id, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/envs/tianshou/lib/python3.11/site-packages/envpool/registration.py", line 99, in make_spec config = spec_cls.gen_config(kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Config.new() got an unexpected keyword argument 'xml_file'

Trinkle23897 commented 7 months ago

Sorry this is hardcode here: https://github.com/sail-sg/envpool/blob/f411fc26c8999ba5b9c39974344903b164486d1a/envpool/mujoco/gym/ant.h#L89