openai / gym

A toolkit for developing and comparing reinforcement learning algorithms.
https://www.gymlibrary.dev
Other
34.77k stars 8.61k forks source link

Runtime warning: invalide value encountered in remainder #1244

Closed mgkumar138 closed 5 years ago

mgkumar138 commented 5 years ago

i am testing my AC code using Pendulum-v0 environment and got this error:

gym\envs\classic_control\pendulum.py:88: RuntimeWarning: invalid value encountered in remainder return (((x+np.pi) % (2*np.pi)) - np.pi)

Afterwhich my rewards during training were [nan]: Episode 23 of 100, score [nan]. Would anyone know what might be the cause for this?

christopherhesse commented 5 years ago

Are you clipping your actions to within the allowed range for the action space of the environment? https://github.com/openai/gym/blob/master/gym/envs/classic_control/pendulum.py#L20

christopherhesse commented 5 years ago

Closing due to lack of activity. Possibly related issue: https://github.com/openai/baselines/issues/121