sail-sg / envpool

C++-based high-performance parallel environment execution engine (vectorized env) for general RL environments.

Home Page:https://envpool.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

dynamicDr opened this issue · comments

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'

Sorry this is hardcode here:

MujocoEnv(spec.config["base_path"_] + "/mujoco/assets_gym/ant.xml",