benelot / pybullet-gym

Open-source implementations of OpenAI Gym MuJoCo environments for use with the OpenAI Gym Reinforcement Learning Research Platform.
https://pybullet.org/
Other
814 stars 124 forks source link

Fix mutable default robot object #61

Closed forcecore closed 3 years ago

forcecore commented 3 years ago

https://github.com/bulletphysics/bullet3/issues/2352 : Fixes this problem.

The mutable robot object instance in the default init parameter caused the default robot object to be shared between multiple instances of environments. For example, if you use stable-baselines3 (where they did the training and evaluation implementation RIGHT), they have separate train and eval environment instantiated and the robot gets shared between the two.

benelot commented 3 years ago

Oh well, mutable default parameters...Thanks!