浏览代码

[Bug Fix] Fix crash if spawn is delayed in multi-env

/MLA-1734-demo-provider
vincentpierre 4 年前
当前提交
3bbd61e4
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 7
      ml-agents/mlagents/trainers/subprocess_env_manager.py

7
ml-agents/mlagents/trainers/subprocess_env_manager.py


@property
def training_behaviors(self) -> Dict[BehaviorName, BehaviorSpec]:
self.env_workers[0].send(EnvironmentCommand.BEHAVIOR_SPECS)
return self.env_workers[0].recv().payload
result: Dict[BehaviorName, BehaviorSpec] = {}
for worker in self.env_workers:
worker.send(EnvironmentCommand.BEHAVIOR_SPECS)
result.update(worker.recv().payload)
return result
def close(self) -> None:
logger.debug("SubprocessEnvManager closing.")

正在加载...
取消
保存