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

fix MujocoPyEnv human render not being freed upon close() #771

Conversation

Kallinteris-Andreas
Copy link
Collaborator

Description

Fixes # #743

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@pseudo-rnd-thoughts
Copy link
Member

@Kallinteris-Andreas Any progress on this?

@Kallinteris-Andreas
Copy link
Collaborator Author

Does not solve the issue

fails this test:

import pytest
import gymnasium as gym
#envs_list = list(gym.registry.keys())
#envs_list = ["Reacher-v2"]
#envs_list = ["Reacher-v2", "Ant-v3"]
envs_list = ["Reacher-v2", "Ant-v5", "Pusher-v2"]



def random_action_on_env(env_name):
    env = gym.make(env_name, render_mode="human")
    observation, info = env.reset()
    for _ in range(100):
        action = env.action_space.sample()  # agent policy that uses the observation and info
        observation, reward, terminated, truncated, info = env.step(action)

        if terminated or truncated:
            observation, info = env.reset()

    env.close()


@pytest.mark.parametrize("env_name", envs_list)
def test_random_actions(env_name):
    """random action on every env"""
    random_action_on_env(env_name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants