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 Report] broken tests for connect_four in CI #1242

Open
David-GERARD opened this issue Nov 22, 2024 · 1 comment · May be fixed by #1243
Open

[Bug Report] broken tests for connect_four in CI #1242

David-GERARD opened this issue Nov 22, 2024 · 1 comment · May be fixed by #1243
Assignees
Labels
bug Something isn't working

Comments

@David-GERARD
Copy link
Collaborator

David-GERARD commented Nov 22, 2024

Describe the bug

The following tests are failing in CI for any PR:

  • Tutorial tests / tutorial-test (3.8, SB3/connect_four)
  • Tutorial tests / tutorial-test (3.9, SB3/connect_four)
  • Tutorial tests / tutorial-test (3.10, SB3/connect_four)
  • Tutorial tests / tutorial-test (3.11, SB3/connect_four)

Code example

Error message:

Installed /opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/AutoROM/roms/zaxxon.bin
Done!
Starting training on connect_four_v3.
Traceback (most recent call last):
  File "/Users/davidgerard/Desktop/Farama/PettingZoo/tutorials/SB3/connect_four/sb3_connect_four_action_mask.py", line 188, in <module>
    train_action_mask(env_fn, steps=20_480, seed=0, **env_kwargs)
  File "/Users/davidgerard/Desktop/Farama/PettingZoo/tutorials/SB3/connect_four/sb3_connect_four_action_mask.py", line 86, in train_action_mask
    env = ActionMasker(env, mask_fn)  # Wrap to enable masking (SB3 function)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/sb3_contrib/common/wrappers/action_masker.py", line 20, in __init__
    super().__init__(env)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/gymnasium/core.py", line 278, in __init__
    assert isinstance(env, Env)
           ^^^^^^^^^^^^^^^^^^^^
AssertionError

Additional context:

  • The env being examined has the following wrapper structure: <SB3ActionMaskWrapper<connect_four_v3>>.
  • connect_four_v3 is inherited from pettingzoo.AECEnv.
  • SB3ActionMaskWrapper is inherited from pettingzoo.utils.BaseWrapper itself inherited from pettingzoo.AECEnv.
@David-GERARD David-GERARD added the bug Something isn't working label Nov 22, 2024
@David-GERARD David-GERARD self-assigned this Nov 22, 2024
@David-GERARD
Copy link
Collaborator Author

David-GERARD commented Nov 23, 2024

Update:

  • The bug has been identified as having appeared with gymnasium v1.0.0a1, with no error encountered when using gymnasium v0.29.1.
  • As pointed out by @pseudo-rnd-thoughts, the following warning indicates that the error likely comes from the deprecation of the method Wrapper.__get_attr__ in favour of the new Wrapper.get_wrapper_attr as per Add deprecation warnings for features removed in Gymnasium v1.0 Gymnasium#535
  • It is still unclear to me why this change created the bug, but I am looking into it.

Partial log message in last successful run of the CI:

Installed /opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/AutoROM/roms/zaxxon.bin
Done!
/opt/hostedtoolcache/Python/3.10.15/x64/lib/python3.10/site-packages/gymnasium/core.py:311: UserWarning: 
WARN: env.action_masks to get variables from other wrappers is deprecated and will be removed in v1.0, to get this variable you can do `env.unwrapped.action_masks` for environment variables or `env.get_wrapper_attr('action_masks')` that will search the reminding wrappers.
  logger.warn(
Starting training on connect_four_v3.
Using cpu device
...

@David-GERARD David-GERARD linked a pull request Nov 24, 2024 that will close this issue
7 tasks
@David-GERARD David-GERARD linked a pull request Nov 24, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant