-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Fix PPO tutorial: Add gymnasium support and Mujoco rendering compatibility in Colab #3401
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3401
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 4cbdff3 with merge base 3b23c0e ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Hi @abhitorch81! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
…compatibility in Colab
a4cf591
to
448dee8
Compare
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
This looks sane from doc point of view, make sure you get approval for the content |
I have added changes with the Gymnasium library as Gym was failing with Google Colab so I have put a condition @AlannaBurke |
@vmoens any update on this ? if possible can you check and update if any changes are to be made. |
@abhitorch81 Are you able to run the tutorial properly with your changes in Google Colab CPU Runtime? If you are using another I would love to learn how you are running your colab. I am getting the error AttributeError: 'NoneType' object has no attribute 'glGetError' . Thoughts? |
Can you check the files the commit that I have mentioned https://github.com/pytorch/tutorials/pull/3401/files |
I ran with your changes exactly and I am getting this error. Let me run this again and see if it happens. I will also take a video capture of my screen so you can see exactly what is going on. |
@abhitorch81 Here is a video screen capture of me running this in Google Colab with your fix. The video shows the problem after time 4:35. Though you can see the whole video to see how I start my runtime etc. I would love to know what I am doing differently than you. Looking forward to hearing from you. |
I will check on this. |
I am adding the updated jupyter notebook,hope it helps |
Thank you very much @abhitorch81 - that fix worked. Wouldn't it be beneficial to check that in too? Also was it previously installed mujoco that you helped clean up or was it the export that helped resolve the issue? |
@vikasbahirwani I tried going with the flow from scratch and it worked.Thanks |
Fixes #3392
Description
This PR updates the
reinforcement_ppo.py
tutorial to improve compatibility with Google Colab and future-proof it forgymnasium
usage.Key Changes:
gymnasium
if available, otherwise fall back togym
InvertedDoublePendulum-v5
orv4
based on the gym versionMUJOCO_GL=osmesa
in Colab/headless environments to avoid OpenGL rendering errors from Mujocogymnasium[mujoco]
This makes the tutorial runnable out of the box in Google Colab, with improved robustness across versions.
Checklist