Skip to content

Commit 9f10462

Browse files
author
Ervin T
authored
Only call get_action on brains with policies (#2437)
1 parent 34300b9 commit 9f10462

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ml-agents-envs/mlagents/envs/subprocess_env_manager.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ def _postprocess_steps(
251251
def _take_step(self, last_step: StepInfo) -> Dict[str, ActionInfo]:
252252
all_action_info: Dict[str, ActionInfo] = {}
253253
for brain_name, brain_info in last_step.current_all_brain_info.items():
254-
all_action_info[brain_name] = self.policies[brain_name].get_action(
255-
brain_info
256-
)
254+
if brain_name in self.policies:
255+
all_action_info[brain_name] = self.policies[brain_name].get_action(
256+
brain_info
257+
)
257258
return all_action_info

0 commit comments

Comments
 (0)