Closed XiaobenLi00 closed 3 weeks ago
I have checked the checklist and update information. @araffin
As the error message suggests, the observation returned by the reset()
method does not match the data type (cannot cast) of the given observation space Box(-10.0, 10.0, (211,), float32). Expected: float32, actual dtype: float64. You need to update the reset function consequently.
(Next time, please use the custom env template.)
As the error message suggests, the observation returned by the
reset()
method does not match the data type (cannot cast) of the given observation space Box(-10.0, 10.0, (211,), float32). Expected: float32, actual dtype: float64. You need to update the reset function consequently.(Next time, please use the custom env template.)
Thanks a lot for your reply, I will check responding reset() method.
BTW, do you have any idea with the render_mode problem?
The problem is that in your reset()
method, you are returning values which are np.float64
.
You need to cast them to np.float32
before the reset() method returns.
For instance:
...
phi = phi.astype(np.float32)
theta = theta.astype(np.float32)
psi = psi.astype(np.float32)
obs = {"Phi": phi, "Theta": theta, "Psi": psi}
return obs
🐛 Bug
I use sb3 for myochallenge, and the env is the myoChallengeBimanual-v0.
When I try to use vecEnv (both SubprocVecEnv and DummyVecEnv), I got warnings like this
When I use check_env, I also got simliar warnings
In summary, I have two problems
render_mode
reset()
methodI did check previous issues, there are similiar problems (https://github.com/DLR-RM/stable-baselines3/issues/921#issue-1249240466, https://github.com/DLR-RM/stable-baselines3/issues/1968#issuecomment-2238440835) but not seems to be solved, so I open this issue
Code example
from https://github.com/MyoHub/myosuite/blob/main/myosuite/agents/sb3_job_script.py
Relevant log output / Error message
System Info
Checklist