araffin / rl-baselines-zoo

A collection of 100+ pre-trained RL agents using Stable Baselines, training and hyperparameter optimization included.
https://stable-baselines.readthedocs.io/
MIT License
1.12k stars 206 forks source link

[Question] Why do envs look different? #112

Closed sash-a closed 3 years ago

sash-a commented 3 years ago

Hi, I'm wondering if this repo/stable-baselines is using different envs to the ones found by default in PyBullet? When running HopperBulletEnv-v0 without stable baselines it looks like this:

image

However when testing from within stable baselines it looks like this:

image

How/where are these changes being done? Any idea if they are purely visual or are there changes to reward functions/joint dynamics?

araffin commented 3 years ago

Hello, This is just camera view vs GUI view from PyBullet, all the rest is the same (you can take a look at PyBullet doc for launching without the gui and for defining cameras).

How/where are these changes being done? Any idea if they are purely visual or are there changes to reward functions/joint dynamics?

yes, purely visual.

EDIT: you probably meant the colors? Are you using the same pybullet version? otherwise, it may be due to BGR vs RGB conversion that is not done properly

sash-a commented 3 years ago

I meant both the colours and the camera position.

I assumed it was only visual just wanted to be sure I wasn't benchmarking against a different env. Another thing I noticed is that this implementation seems to run in real time (when rendering), whereas in my testing when rendering it still runs very fast, possibly a clue as to what's going on. Regardless thanks for the help.

araffin commented 3 years ago

Another thing I noticed is that this implementation seems to run in real time (when rendering)

you mean it runs much faster in the default GUI?

See https://github.com/bulletphysics/bullet3/pull/2627#issuecomment-593059710 and https://github.com/bulletphysics/bullet3/blob/master/examples/pybullet/gym/pybullet_envs/stable_baselines/enjoy.py#L75

(it uses a sleep with the default GUI so you can take a look at it)