-
Notifications
You must be signed in to change notification settings - Fork 903
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
Shape mismatch in MJX's put_data function #2141
Comments
The issue seems to be due to the fact the the Mujoco did not instantiate efc_J property of the model, but running the mj_step once before the put_data call seems to have resolved the issue |
It's good that you found the solution, but That, I think, is a bug. WDYT @erikfrey ? |
@yuvaltassa we finally completed the research project we were working on - Benchmarking MJX vs Mujoco vs combining resource allocation with Mujoco and MJX running in parallel on a single machine - thought I might share if you're interested and was hoping for your opinion on methodology and whether you feel that the experiment was fairly conducted. 🔍 Key Observations: |
Hi @rustam-e, Two things you should do for your MJX benchmarking:
def unroll(d, _):
d = step(mjx_model, d)
return d, None
unroll_fn = jax.jit(lambda d: jax.lax.scan(unroll, d, None, length=n_n_steps, unroll=4)[0])
# burn in
datas = unroll_fn(datas)
# measure
t = time.perf_counter()
...
datas.qpos.block_until_ready()
elapsed = = time.perf_counter() - t re: bug yes agreed you shouldn't need to call |
Intro
Hi!
I am a masters student at Vrije Universiteit Amsterdam, I use MuJoCo for my research on Modular Robotics.
My setup
Currently, Mujoco - trying to convert existing Evolutionary Computing for modular robotics framework Revolve2 (https://github.com/ci-group/revolve2) from Mujoco to MJX 3.2.3
What's happening? What did you expect?
I am following the provided tutorial on https://colab.research.google.com/github/google-deepmind/mujoco/blob/main/mjx/tutorial.ipynb#scrollTo=Jtz7j1PDOnw5 and convert currently working code running the mujoco.mj_step to run using MJX.
I get an error related efc_J:
Steps for reproduction
python examples/4_example_experiment_setups/4c_robot_bodybrain_ea-mjx/main.py
the only differences from a functional
examples/4_example_experiment_setups/4c_robot_bodybrain_ea/main.py
can be found in rustam-e/revolve2@30bfc7fMinimal model for reproduction
the issue is consistent with all of the experiements we ran
Code required for reproduction
running any of the examples by changing
from:
from revolve2.simulators.mujoco_simulator import LocalSimulator
to:
from revolve2.simulators.mjx_simulator import LocalSimulator
would throw consistently the same error like:
ValueError: could not broadcast input array from shape (0,10) into shape (4,10)
the only diference across examples being the second dimension
Confirmations
The text was updated successfully, but these errors were encountered: