mirror of
https://github.com/wassname/pytorch-a2c-ppo-acktr.git
synced 2026-06-27 16:20:05 +08:00
Add pybullet support
This commit is contained in:
@@ -26,8 +26,16 @@ It's extremely difficult to reproduce results for Reinforcement Learning methods
|
|||||||
* Improve performance of KFAC, see kfac.py for more information
|
* Improve performance of KFAC, see kfac.py for more information
|
||||||
* Run evaluation for all games and algorithms
|
* Run evaluation for all games and algorithms
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
* [PyTorch](http://pytorch.org/)
|
||||||
|
* [Visdom](https://github.com/facebookresearch/visdom)
|
||||||
|
* [OpenAI baselines](https://github.com/openai/baselines)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
Start a `Visdom` server with `python -m visdom.server`, it will serve `http://localhost:8097/` by default.
|
||||||
|
|
||||||
### Atari
|
### Atari
|
||||||
#### A2C
|
#### A2C
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,11 @@ from baselines.common.atari_wrappers import wrap_deepmind
|
|||||||
|
|
||||||
def make_env(env_id, seed, rank, log_dir):
|
def make_env(env_id, seed, rank, log_dir):
|
||||||
def _thunk():
|
def _thunk():
|
||||||
env = gym.make(env_id)
|
if env_id.find('Bullet') > -1:
|
||||||
|
import pybullet_envs
|
||||||
|
env = pybullet_envs.make(env_id)
|
||||||
|
else:
|
||||||
|
env = gym.make(env_id)
|
||||||
env.seed(seed + rank)
|
env.seed(seed + rank)
|
||||||
env = bench.Monitor(env,
|
env = bench.Monitor(env,
|
||||||
os.path.join(log_dir,
|
os.path.join(log_dir,
|
||||||
|
|||||||
Reference in New Issue
Block a user