[Bug Report] Lunar Lander Runs SlowlySee original GitHub issue
Describe the bug
The Lunar Lander environment creates particles and updates their physics, even when not being rendered. This slows down wall-time training on the environment by ~5x-10x.
Wrapping said code within the step(.) function with if self.render_mode == “human”: resolves the issue.
if self.render_mode == "human": p = self._create_particle( 3.5, # 3.5 is here to make particle speed adequate impulse_pos, impulse_pos, m_power, ) # particles are just a decoration p.ApplyLinearImpulse( (ox * MAIN_ENGINE_POWER * m_power, oy * MAIN_ENGINE_POWER * m_power), impulse_pos, True, )
- I have checked that there is no similar issue in the repo
- Created 10 months ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
I’m currently at
if self.render_mode is not None. That seems to cover all cases.
If the rendering is deterministic, could you save the rendered frames then make the change and see if the rendered frames are the same (using the same actions and reset seed). Don’t think we want this added to the actual tests, could include the test code for someone to replicate. Then add a quick performance test to show the difference in fps?
I don’t think we can add anything to the actual tests in the project as the old version won’t exist after the fix.