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

bugfixes: gym->gymnasium; render() update #769

Merged
merged 7 commits into from
Nov 11, 2022

Conversation

WillDudley
Copy link
Contributor

@WillDudley WillDudley commented Nov 7, 2022

Credits (names from the Farama Discord):

  • Reid
  • Puckyle
  • chattershuts

@WillDudley
Copy link
Contributor Author

WillDudley commented Nov 7, 2022

@Trinkle23897 PettingZoo*Tianshou tutorials are now live at https://pettingzoo.farama.org/tutorials/tianshou/beginner/

They pass CI, so there shouldn't be issues - if there are, feel free to check the workflow at: https://github.com/Farama-Foundation/PettingZoo/blob/master/.github/workflows/linux-tutorials-test.yml

Or just pop me a ping :)

Hope this clears up any confusion!

@nrwahl2
Copy link

nrwahl2 commented Nov 7, 2022

Reid == @nrwahl2 :)

Thanks, Will!

@Trinkle23897
Copy link
Collaborator

Trinkle23897 commented Nov 7, 2022

When I run python test/pettingzoo/test_tic_tac_toe.py:

Traceback (most recent call last):
  File "test/pettingzoo/test_tic_tac_toe.py", line 21, in <module>
    test_tic_tac_toe(get_args())
  File "test/pettingzoo/test_tic_tac_toe.py", line 17, in test_tic_tac_toe
    watch(args, agent)
  File "/home/trinkle/github/tianshou-new/test/pettingzoo/tic_tac_toe.py", line 240, in watch
    result = collector.collect(n_episode=1, render=args.render)
  File "/home/trinkle/github/tianshou-new/tianshou/data/collector.py", line 354, in collect
    self.env.render()
  File "/home/trinkle/github/tianshou-new/tianshou/env/venvs.py", line 355, in render
    return [w.render(**kwargs) for w in self.workers]
  File "/home/trinkle/github/tianshou-new/tianshou/env/venvs.py", line 355, in <listcomp>
    return [w.render(**kwargs) for w in self.workers]
  File "/home/trinkle/github/tianshou-new/tianshou/env/worker/dummy.py", line 49, in render
    return self.env.render(**kwargs)
  File "/home/trinkle/github/tianshou-new/tianshou/env/pettingzoo_env.py", line 150, in render
    return self.env.render()
  File "/home/trinkle/.local/lib/python3.8/site-packages/pettingzoo/utils/wrappers/order_enforcing.py", line 64, in render
    return super().render()
  File "/home/trinkle/.local/lib/python3.8/site-packages/pettingzoo/utils/wrappers/base.py", line 88, in render
    return self.env.render()
  File "/home/trinkle/.local/lib/python3.8/site-packages/pettingzoo/utils/wrappers/base.py", line 88, in render
    return self.env.render()
  File "/home/trinkle/.local/lib/python3.8/site-packages/pettingzoo/utils/wrappers/base.py", line 88, in render
    return self.env.render()
  File "/home/trinkle/.local/lib/python3.8/site-packages/pettingzoo/classic/tictactoe/tictactoe.py", line 231, in render
    gymnasium.logger.WARN(
TypeError: 'int' object is not callable

Also, can you add three links to tianshou's doc? Either create a subsection after multi-agent in cheatsheet, or just insert in that subsection

@APN-Pucky
Copy link

Puckyle == @APN-Pucky

I think pettingzoo should maybe directly link/copy this very useful tianshou tutorial https://tianshou.readthedocs.io/en/master/tutorials/tictactoe.html#tic-tac-toe-environment.

@codecov-commenter
Copy link

codecov-commenter commented Nov 11, 2022

Codecov Report

Merging #769 (7cb9130) into master (06aaad4) will decrease coverage by 0.15%.
The diff coverage is 60.00%.

@@            Coverage Diff             @@
##           master     #769      +/-   ##
==========================================
- Coverage   91.24%   91.08%   -0.16%     
==========================================
  Files          71       71              
  Lines        5082     5082              
==========================================
- Hits         4637     4629       -8     
- Misses        445      453       +8     
Flag Coverage Δ
unittests 91.08% <60.00%> (-0.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
tianshou/env/worker/base.py 65.45% <0.00%> (ø)
tianshou/utils/logger/base.py 91.83% <0.00%> (ø)
tianshou/env/pettingzoo_env.py 88.13% <80.00%> (ø)
tianshou/data/utils/converter.py 100.00% <100.00%> (ø)
tianshou/policy/multiagent/mapolicy.py 83.90% <0.00%> (-9.20%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@WillDudley
Copy link
Contributor Author

@Trinkle23897 Really sorry for the delay. I've just released 1.22.2 for PZ which deals with the WARN bug.

@Trinkle23897 Trinkle23897 merged commit b9a6d8b into thu-ml:master Nov 11, 2022
BFAnas pushed a commit to BFAnas/tianshou that referenced this pull request May 5, 2024
Credits (names from the Farama Discord):

- @nrwahl2
- @APN-Pucky
- chattershuts
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.

pettingzoo render have problem TypeError: render() takes 1 positional argument but 2 were given
5 participants