From 95a1c338d1f2cb686f58dbe011f1e27786bff5f9 Mon Sep 17 00:00:00 2001 From: thatguy11325 <148832074+thatguy11325@users.noreply.github.com> Date: Fri, 21 Jun 2024 01:28:11 -0400 Subject: [PATCH] Fixes for python3.11 --- pokemonred_puffer/cleanrl_puffer.py | 6 +++--- pokemonred_puffer/environment.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pokemonred_puffer/cleanrl_puffer.py b/pokemonred_puffer/cleanrl_puffer.py index 77c9421..3582fea 100644 --- a/pokemonred_puffer/cleanrl_puffer.py +++ b/pokemonred_puffer/cleanrl_puffer.py @@ -129,9 +129,9 @@ class CleanPuffeRL: env_send_queues: list[Queue] env_recv_queues: list[Queue] wandb_client: wandb.wandb_sdk.wandb_run.Run | None = None - profile: Profile = Profile() - losses: Losses = Losses() - utilization: Utilization = Utilization() + profile: Profile = field(default_factory=lambda: Profile()) + losses: Losses = field(default_factory=lambda: Losses()) + utilization: Utilization = field(default_factory=lambda: Utilization()) global_step: int = 0 epoch: int = 0 stats: dict = field(default_factory=lambda: {}) diff --git a/pokemonred_puffer/environment.py b/pokemonred_puffer/environment.py index a98564f..5b2c2d8 100644 --- a/pokemonred_puffer/environment.py +++ b/pokemonred_puffer/environment.py @@ -584,7 +584,6 @@ def run_action_on_emulator(self, action): # TODO: Add video saving logic if not self.disable_ai_actions: - self.pyboy.button() self.pyboy.send_input(VALID_ACTIONS[action]) self.pyboy.send_input(VALID_RELEASE_ACTIONS[action], delay=8) self.pyboy.tick(self.action_freq, render=True)