Initializing default saver inside the function (#6540)

This commit is contained in:
Eyal Sela 2019-12-19 12:29:45 -08:00 committed by Simon Mo
parent 634b437543
commit 7b955881f3

View file

@ -297,11 +297,14 @@ def rollout(agent,
env_name,
num_steps,
num_episodes=0,
saver=RolloutSaver(),
saver=None,
no_render=True,
monitor=False):
policy_agent_mapping = default_policy_agent_mapping
if saver is None:
saver = RolloutSaver()
if hasattr(agent, "workers"):
env = agent.workers.local_worker().env
multiagent = isinstance(env, MultiAgentEnv)