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] AttributeError: accessing private attribute '_cumulative_rewards' is prohibited #877
Comments
Are you still having this issue? Not sure why this would give you an error, as almost all of the other envs do the same thing in their code (e.g., chess: |
I have changed the code since then, so I can't reproduce it on my local machine. However, I tried to re-run the colab notebook and the bug is still there. It seems to be caused by this particular observation space Edit: I deleted the previous comment and added this one as I wasn't able to add markdown code |
Thanks for the feedback. Any chance you could run a debugger on the code from colab notebook locally? (e.g., using pycharm debugger) I find that’s usually the best way to find the cause of tricky bugs like this. Otherwise I can look into it when I get a chance, but I figure you know your own code best so you might be able to better identify the problem. |
Ok I think I got it, the problem was not the observation space, as the problem persists even with other spaces. The problem is that I think the problem can be fixed in three ways
|
The third options seems most reasonable to me, would you mind creating a PR for that? @LetteraUnica |
I have opened a pull request #904, however I wasn't able to run any tests as I made the changes on a windows machine, if you want I can execute the tests on linux late next week and open a new pull request. |
Describe the bug
When creating a wrapper around an environment and overriding only the seed method, when I try to call the .last() method of the wrapped environment I get: AttributeError: accessing private attribute '_cumulative_rewards' is prohibited.
It seems the error only happens if the environment has an observation space with spaces.Sequence in it, as this does not happen on other pettinzoo environments and spaces that I tested.
I managed to re-create the issue on this colab notebook, I have also attached the same code below.
Code example
System info
Pettingzoo version: 1.22.3
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: