Skip to content

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

@MacQWER

Description

@MacQWER

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions