Skip to content

Commit

Permalink
Attempt to tune the number of envs
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguy11325 committed Jun 21, 2024
1 parent d38e231 commit 8eb33bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 5 additions & 3 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -113,6 +113,8 @@ train:
# swarm_keep_pct: .8

wrappers:
empty: []

baseline:
- stream_wrapper.StreamWrapper:
user: thatguy
Expand Down
8 changes: 8 additions & 0 deletions pokemonred_puffer/wrappers/stream_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 8eb33bf

Please sign in to comment.