Skip to content

Commit

Permalink
pettingzoo example observation_space fix (#1243)
Browse files Browse the repository at this point in the history
Had to make few changes to run tictactoe example (was getting errors
otherwise)

---------

Co-authored-by: YASH CHANDRA <yash@cloudfeather.games>
  • Loading branch information
yashschandra and yashcfg authored Feb 22, 2025
1 parent 0a79016 commit c4ae7cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/pettingzoo/tic_tac_toe.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def get_agents(
) -> tuple[BasePolicy, torch.optim.Optimizer | None, list]:
env = get_env()
observation_space = (
env.observation_space["observation"]
env.observation_space.spaces["observation"]
if isinstance(env.observation_space, gymnasium.spaces.Dict)
else env.observation_space
)
Expand Down Expand Up @@ -235,5 +235,5 @@ def watch(
policy, optim, agents = get_agents(args, agent_learn=agent_learn, agent_opponent=agent_opponent)
policy.policies[agents[args.agent_id - 1]].set_eps(args.eps_test)
collector = Collector[CollectStats](policy, env, exploration_noise=True)
result = collector.collect(n_episode=1, render=args.render)
result = collector.collect(n_episode=1, render=args.render, reset_before_collect=True)
result.pprint_asdict()

0 comments on commit c4ae7cd

Please sign in to comment.