mujoco强化学习报错 'mujoco._structs.MjData' object has no attribute 'solver_iter'
MjData has no attribute solver_iter
在用 Mujoco 和 Gymnasium 做强化学习时报错 ‘mujoco._structs.MjData’ object has no attribute ‘solver_iter’,下面是github上大神的解释:
When using version 3.0.0 of MuJoCo and working with Gymnasium I’m getting the following error while trying to render any MuJoCo environment in “human” mode
‘mujoco._structs.MjData’ object has no attribute ‘solver_iter’
Downgrading to version 2.3.7 fixes the issue.
I’m guessing the error is related to this line in the change log
Renamed mjData.solver_iter to solver_niter. Both this member and mjData.solver_nnz are now integer vectors of length mjNISLAND。
所以把mujoco_rendering.py文件第593行代码中的 self.data.solver_iter 更改为 self.data.solver_niter 即可。