google-deepmind / google-deepmind/mujoco

AttributeError: 'State' object has no attribute 'pos' in mjx/training_apg.ipynb

Open
#2,822 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
15.2k
Forks
1.8k
Avg merge
10d 16h
Merged PRs (30d)
25

Description

### Intro

Hi!

Recently, I have been using MuJoCo for my research on First-order Policy gradients (FoPG).

### My setup

Colab and Ubuntu 20.04
mujoco 3.3.0
jax 0.5.3
brax 0.12.1

### What's happening? What did you expect?

I am encountering an AttributeError: 'State' object has no attribute 'pos' when running the train_apg.ipynb example. The error occurs specifically when calling the train_fn function as follows:
make_inference_fn, params, _= train_fn(environment=env,
progress_fn=progress,
eval_env=eval_env)
And the screenshot of the error is :

Image

I have confirmed that the same code runs without issues in my old environment with mujoco 3.3.0, jax 0.5.3, brax 0.12.1. However, in my new environment with MuJoCo MJX 3.3.5, the problem consistently appears. This suggests that the training_apg.ipynb example may be using an outdated API that is no longer compatible with the latest MuJoCo MJX version.

### Steps for reproduction

Just run training_apg.ipynb, with the new version of mjx and brax, this problem can be reproduced.

### Minimal model for reproduction

### Code required for reproduction

### Confirmations

- [x] I searched the [latest documentation](https://mujoco.readthedocs.io/en/latest/overview.html) thoroughly before posting.
- [x] I searched previous [Issues](https://github.com/google-deepmind/mujoco/issues) and [Discussions](https://github.com/google-deepmind/mujoco/discussions), I am certain this has not been raised before.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.