qgallouedec / panda-gym

Set of robotic environments based on PyBullet physics engine and gymnasium.
MIT License
492 stars 106 forks source link

how to realize the sb3 train demo code with panda-gym? #74

Closed NUSLCC closed 10 months ago

NUSLCC commented 10 months ago

Tried and failed with panda-gym==2.0.0 as required, gym==0.26.2, stable-baseline3==2.1.0 Can anyone provide a clue of how to run the demo train code, thanks!! Also tried to downgrade the gym==0.21.0 by #19, still failed. image

qgallouedec commented 10 months ago

The documentation was not up to date. It should be fixed now. Use the following code:

import gymnasium as gym
import panda_gym
from stable_baselines3 import DDPG

env = gym.make("PandaReach-v3")
model = DDPG(policy="MultiInputPolicy", env=env)
model.learn(30_000)
NUSLCC commented 10 months ago

Thanks! It works in my environment now.