Last active
August 25, 2019 23:18
-
-
Save AurelianTactics/2e01e6225510662b3c355af092c5edbc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_env(env_id, log_dir, rank): | |
def _init(): | |
env = UnityEnv(env_id, worker_id=rank, use_visual=False) | |
env = Monitor(env, log_dir, allow_early_resets=True) | |
return _init | |
env_id = "unity_ray/basic_env_linux/basic_env_linux" | |
num_env = 2 | |
worker_id = 9 | |
env = SubprocVecEnv([make_env(env_id, log_dir, i+worker_id) for i in range(num_env)]) | |
model = PPO2(MlpPolicy, env, verbose=1) | |
model.learn(total_timesteps=10000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment