浏览代码

trainer will raise an error if the memory of the brain is set wrong (#273)

/develop-generalizationTraining-TrainerController
Arthur Juliani 7 年前
当前提交
7bf0c888
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8
      python/trainers/ppo_trainer.py

8
python/trainers/ppo_trainer.py


if self.use_recurrent:
self.m_size = env.brains[brain_name].memory_space_size
self.sequence_length = trainer_parameters["sequence_length"]
if self.use_recurrent:
if (self.m_size == 0):
raise UnityTrainerException("The memory size for brain {0} is 0 even though the trainer uses recurrent."
.format(brain_name))
elif (self.m_size % 4 != 0):
raise UnityTrainerException("The memory size for brain {0} is {1} but it must be divisible by 4."
.format(brain_name, self.m_size))
self.variable_scope = trainer_parameters['graph_scope']
with tf.variable_scope(self.variable_scope):
self.model = create_agent_model(env.brains[brain_name],

正在加载...
取消
保存