Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RLlib] Issue 17706: AttributeError: 'numpy.ndarray' object has no attribute 'items'" on certain turn-based MultiAgentEnvs with Dict obs space. #17735

Merged
merged 1 commit into from
Aug 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion rllib/evaluation/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import queue
import threading
import time
import tree # pip install dm_tree
from typing import Any, Callable, Dict, List, Iterable, Optional, Set, Tuple,\
Type, TYPE_CHECKING, Union

Expand Down Expand Up @@ -778,7 +779,8 @@ def _process_observations(
obs_sp = worker.policy_map[episode.policy_for(
ag_id)].observation_space
obs_sp = getattr(obs_sp, "original_space", obs_sp)
all_agents_obs[ag_id] = np.zeros_like(obs_sp.sample())
all_agents_obs[ag_id] = tree.map_structure(
np.zeros_like, obs_sp.sample())
else:
hit_horizon = False
all_agents_done = False
Expand Down