liuzuxin / DSRL

🔥 Datasets and env wrappers for offline safe reinforcement learning
https://offline-saferl.org
Apache License 2.0
63 stars 4 forks source link

Failed to rendering the metadrive environment #7

Closed guanjiayi closed 1 month ago

guanjiayi commented 1 month ago

I encountered an error when using env.render() to render the MetaDrive environment. Have you successfully visualized the 9 environments in DSRL before? If so, could you provide the versions of Panda and Panda3D you used?

Error message:

Traceback (most recent call last):
 File "make_envs.py", line 12, in <module>
    env.render()
  File "/home/tjispc_rl/anaconda3/envs/metadrive/lib/python3.8/site-packages/gym/wrappers/order_enforcing.py", line 51, in render
    return self.env.render(*args, **kwargs)
  File "/home/tjispc_rl/anaconda3/envs/metadrive/lib/python3.8/site-packages/gym/wrappers/env_checker.py", line 53, in render
    return env_render_passive_checker(self.env, *args, **kwargs)
  File "/home/tjispc_rl/anaconda3/envs/metadrive/lib/python3.8/site-packages/gym/utils/passive_env_checker.py", line 316, in env_render_passive_checker
    result = env.render(*args, **kwargs)
  File "/home/tjispc_rl/opt/metadrive_clean/metadrive/envs/base_env.py", line 305, in render
    assert self.config["use_render"] or self.engine.mode != RENDER_MODE_NONE, \
AssertionError: Panda Renderring is off now, can not render
HenryLHH commented 1 month ago

Hi @guanjiayi, the panda3d version we are using is 1.10.8, you may find our MetaDrive version (adopted from v0.2.6.0) in this repo.

HenryLHH commented 1 month ago

Hi @guanjiayi, thank you for raising the issue, we provide a detailed example script which now support modifying the config of Metadrive env.

Besides, for the third-person view rendering part, our original dirty version of Metadrive simulator misses a few logo assets, so we also update the metadrive_clean repo. You can simply re-run the following command in the DSRL repo to fix the third-person view rendering bug:

pip3 install -e .[metadrive]