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

Enable gymnasium 1.0.0 and fix tutorials #4

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

MateuszGuzek
Copy link
Contributor

@MateuszGuzek MateuszGuzek commented Dec 16, 2024

Fixes #1 in README and tutorial
Fix a bug in tutorial_benchmarking
Extend rendering for 30 frames / 1s for more meaningful videos.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 16, 2024
@@ -325,7 +339,7 @@
"\n",
"observation, _ = env.reset()\n",
"frames = [env.render()]\n",
"for i in range(10):\n",
"for i in range(30):\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these changes (10 steps to 30) relevant for the fix? Same for the motions_files -> motions change and commenting out frames?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10 to 30 is just aesthetics, but motions_files -> motions must be fixed (however it is not related to #1) .

tutorial.ipynb Outdated
@@ -24,9 +24,15 @@
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"os.environ[\"MUJOCO_GL\"] = os.environ.get(\"MUJOCO_GL\", \"egl\")\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add comment here to try "glfw" or "osmesa" if egl throws errors (think "glfw" was the most robust pick for us)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the lines for consistency with the basic tutorials (i.e. keep this setup on the user side)

@@ -80,13 +86,21 @@
"outputs": [],
"source": [
"device = \"cpu\"\n",
"\n",
"if Version(\"0.26\") <= Version(gymnasium.__version__) < Version(\"1.0\"):\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the lowerbound check here necessary? If lower versions are not supported, should just throw an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, lower versions should not exist.

I will keep for now as-is, as this is consistent with the way we do it in the HumEnv. If we want to change that, let's do a dedicated change in both repos.

Copy link
Contributor

@Miffyli Miffyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM although did not run the code. Might want to minimize number of changes to ones relevant for fixing #1

@MateuszGuzek MateuszGuzek changed the title Enable gymnasium 1.0.0 in tutorials and README Enable gymnasium 1.0.0 and fix tutorials Dec 16, 2024
@MateuszGuzek MateuszGuzek merged commit ff0d9a1 into main Dec 16, 2024
1 check passed
@MateuszGuzek MateuszGuzek deleted the enable_gym1.0_in_tutorials branch December 16, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gymnasium version must lower than 1.0.0
3 participants