Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dynamicDr opened this issue Mar 8, 2024 · 1 comment
Open
Assignees
Labels
question Further information is requested

Comments

@dynamicDr
Copy link

dynamicDr commented Mar 8, 2024

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
Copy link
Collaborator

Sorry this is hardcode here:

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

@Trinkle23897 Trinkle23897 added the question Further information is requested label Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants