-
-
Notifications
You must be signed in to change notification settings - Fork 827
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 Fix] Small fixes for new mujoco release 3.0.0 #746
[Bug Fix] Small fixes for new mujoco release 3.0.0 #746
Conversation
This will also require a version bump of mujoco to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be careful with changing the models, that would require a lot of validation
Is one of you able to gather training results for the updated swimmer to compare to the old? |
@pseudo-rnd-thoughts working on that |
Thank you @Kallinteris-Andreas for testing. Just to add to the discussion, the xml changes don't affect the behavior/dynamics of the model. Seems like mujoco made this change because it was redundant to specify it this way. To explain how the changes don't modify the behavior:
Training results should be identically hopefully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the new swimmer.xml
with those versions of mujoco
for 1mil steps each and have confirmed identical behavior
(validation repo: https://github.com/Kallinteris-Andreas/gym-mjc-v5-model-validation/tree/main/swimmer)
tested mujoco
versions
"mujoco==2.1.5"
"mujoco==2.2.0"
"mujoco==2.2.1"
"mujoco==2.2.2"
"mujoco==2.3.0"
"mujoco==2.3.1"
"mujoco==2.3.2"
"mujoco==2.3.3"
"mujoco==2.3.5"
"mujoco==2.3.6"
"mujoco==2.3.7"
"mujoco-py==2.1.2.14" # note rendering was not identical, but that is unrelated to the model #690
@@ -611,7 +611,7 @@ def _create_overlay(self): | |||
|
|||
self.add_overlay(bottomleft, "FPS", "%d%s" % (1 / self._time_per_render, "")) | |||
self.add_overlay( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible to maintain support for both pre 3.0 and post 3.0 mujoco
(which is important for reproducibility), by doing this
if mujoco.__version__ => "3.0.0":
self.add_overlay(
bottomleft, "Solver iterations", str(self.data.solver_niter[0] + 1)
)
elif mujoco.__version__ < "3.0.0":
self.add_overlay(
bottomleft, "Solver iterations", str(self.data.solver_iter + 1)
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we are good to merge with no impact on the end users
Description
Fix for mujoco rendering: The
MjData
membersolver_iter
has been renamed tosolver_niter
as specified in the changelog. We are also not using islands in our environments so we just output the first element of the list. Fixes MjData has no attribute solver_iter google-deepmind/mujoco#1107Fix for swimmer xml: As specified in the 11 point of the changelog the
collision
argument has been removed fromoption
.This PR makes the changes specified in the migration guide. The changelog provides the migration guide for
"pair"
that in the previous mujoco release documentation appears to be named as"predefined"
such as in the swimmer xml (seems like a release note errata). I haven't compared reproducibility with the currentSwimmer-v5
environment, but as specified in the docs mujoco only guaranties reproducibility for a fixed version https://mujoco.readthedocs.io/en/3.0.0/computation/index.html?highlight=reproducibility#reproducibilityType of change
Please delete options that are not relevant.
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist:
pre-commit
checks withpre-commit run --all-files
(seeCONTRIBUTING.md
instructions to set it up)