only try to start env if it is closed

This commit is contained in:
Alexander Soare 2024-03-22 15:32:55 +00:00
parent e698d38a35
commit d43fa600a0
1 changed files with 2 additions and 1 deletions

View File

@ -90,7 +90,8 @@ def eval_policy(
if policy is not None:
policy.clear_action_queue()
env.start() # needed to be able to get the seeds the first time as BatchedEnvs are lazy
if env.is_closed:
env.start() # needed to be able to get the seeds the first time as BatchedEnvs are lazy
seeds.extend(env._next_seed)
with torch.inference_mode():
# TODO(alexander-soare): When `break_when_any_done == False` this rolls out for max_steps even when all