diff --git a/config.yaml b/config.yaml index bcf1c13..aad6bf2 100644 --- a/config.yaml +++ b/config.yaml @@ -92,9 +92,9 @@ train: bptt_horizon: 16 vf_clip_coef: 0.1 - num_envs: 96 - num_workers: 96 - env_batch_size: 32 + num_envs: 288 + num_workers: 24 + batch_size: 72 env_pool: True zero_copy: False @@ -113,6 +113,8 @@ train: # swarm_keep_pct: .8 wrappers: + empty: [] + baseline: - stream_wrapper.StreamWrapper: user: thatguy diff --git a/pokemonred_puffer/wrappers/stream_wrapper.py b/pokemonred_puffer/wrappers/stream_wrapper.py index dba7872..06c6ee9 100644 --- a/pokemonred_puffer/wrappers/stream_wrapper.py +++ b/pokemonred_puffer/wrappers/stream_wrapper.py @@ -30,6 +30,14 @@ def __init__(self, env: RedGymEnv, config: pufferlib.namespace): else: raise Exception("Could not find emulator!") + def __del__(self): + try: + for task in asyncio.all_tasks(): + task.cancel() + self.loop.close() + except RuntimeError: + pass + def step(self, action): x_pos = self.env.unwrapped.read_m("wXCoord") y_pos = self.env.unwrapped.read_m("wYCoord")