File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 77from typing import Optional
88
99import quoridor_env
10+ import torch
1011import wandb
1112from plugins .wandb_train import WandbParams
1213from utils import set_deterministic
@@ -258,3 +259,7 @@ def run_self_play_games(
258259 list (alphazero_agent .replay_buffer ),
259260 )
260261 )
262+
263+ del alphazero_agent
264+ if torch .cuda .is_available ():
265+ torch .cuda .empty_cache ()
Original file line number Diff line number Diff line change 1+ import torch
12from agents import Agent
23from agents .alphazero .alphazero import AlphaZeroAgent
34from agents .core .agent import AgentRegistry
@@ -144,11 +145,17 @@ def compute(
144145 absolute_elo = elo_table [agent .name ()]
145146
146147 dumb_score = self .dumb_score (agent )
148+ del agent
147149
148150 if isinstance (agent , AlphaZeroAgent ):
149151 raw_play_encoded_name = override_subargs (play_encoded_name , {"mcts_n" : 0 })
150152 agent_raw = AgentRegistry .create_from_encoded_name (raw_play_encoded_name , arena .game )
151153 dumb_score_raw = self .dumb_score (agent_raw , verbose = True )
154+ del agent_raw
155+
156+
157+ if torch .cuda .is_available ():
158+ torch .cuda .empty_cache ()
152159
153160 return (
154161 VERSION ,
You can’t perform that action at this time.
0 commit comments