-
-
Notifications
You must be signed in to change notification settings - Fork 92
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 breaking changes in OpenAI gym regarding step and reset return signatures #334
Conversation
18144c8
to
8c5c0dc
Compare
1a7f522
to
6516b1e
Compare
6516b1e
to
dadcfe1
Compare
This should be compatible with the new gym changes from patch 0.26.0 |
c91d78e
to
ef22784
Compare
708c4d6
to
87acc12
Compare
Hi @MatteoH2O1999, (.venv) victor@MacBook-Pro-de-Victor examples % python rl_with_new_open_ai_gym_wrapper.py Any idea? Thank you. Víctor |
@victor-cristino, the problem is an incopatibility between the library used in the example and the new Gym API. Try using the new wrapper when not testing the env and check if it changes. (venv) pip install -r requirements.txt -r requirements-dev.txt -r examples/requirements.txt |
I git cloned your branch FixSeed, got requirements done and run (pyenv) victor@MacBook-Pro-de-Victor poke-env-matteo % python examples/rl_with_new_open_ai_gym_wrapper.py Seems to be a small problem about imports. Víctor |
@victor-cristino you are not actually using the new version. With anaconda you have to update what is installed in your virtual env. Right now you have installed the base repo. git clone repo/to/use
git checkout branch/to/use
cd path/to/repo
python -m venv venv
source venv/bin/activate (on mac)
./venv/Scripts/activate (on windows)
python -m pip install --upgrade pip
pip install wheel
pip install -r requirements.txt
pip install -e . from here, the dev version of the repo is installed in the virtual environment and you can use it python examples/example.py The -e means "editable", so if you update the repo, the package gets updates as well |
Hi @MatteoH2O1999 First of all thank you for your quick clean instructive replies. I followed your instructions and I could carry out my first training (venv) victor@MacBook-Pro-de-Victor poke-env-matteo % python3.9 examples/rl_with_new_open_ai_gym_wrapper.py (venv) victor@MacBook-Pro-de-Victor poke-env-matteo % Eventually I am trying to develop a self play project for vgc (doubles). Actually I think examples/experimental-self-play is not working at the moment but that's another issue :) Thanks a lot. Víctor |
12e92b3
to
e715236
Compare
Codecov Report
@@ Coverage Diff @@
## master #334 +/- ##
==========================================
+ Coverage 89.10% 89.20% +0.10%
==========================================
Files 35 38 +3
Lines 3616 3475 -141
==========================================
- Hits 3222 3100 -122
+ Misses 394 375 -19 |
5027778
to
51a3d41
Compare
51a3d41
to
f9b6b0e
Compare
this fixes the issues with the example for me. However, only issue I get though is that for some reason, the async call to reset the environment never returns and the program hangs forever, I fixed this by removing a line of code in the "env = copy.copy(env)" on line 756 in the wrap_for_old_gym_api. Let me know if you get this issue too. |
Could you be a little more specific: which method of which class are you calling? With what parameters? What OS and Python version are you using? |
3de63e4
to
13e8c0a
Compare
13e8c0a
to
8f41500
Compare
Also could we please move this to an isssue? |
@MatteoH2O1999 Sure thing, in the rl_with_new_open_ai_gym_wrapper.py the .close() and .reset_env() functions called on an environment such as train_env or eval_env cause the program to hang no matter which inputs I give it. This only happens to environments that have been wrapped by the wrap_for_old_gym_api() function as it does not happen with the test_env in the example. Of course, the entire program does not work if this wrap is not applied as this is the point of this PR I assume. For me, removing the line "env = copy.copy(env)" in the function wrap_for_old_gym_api() fixed the issue. I made no other changes. I am on windows 11, python 3.10.10 and here is my pip list: absl-py 1.4.0 I am running it in a virtual environment created with the exact specifications you had mentioned previously in VS Code. I am also running a local pokemon-showdown in the way it is described in the README. Let me know if I missed something, I am quite new to poke-env. |
@KenanRustamov , try now with the updated non-rebased FixSeed branch |
@MatteoH2O1999 New branch works, seems like the changes you made to replace the .copy method fixed it. Thanks! |
Should fix #333