强化学习教练:Saver 无法恢复代理的检查点

Reinforcement Learning coach : Saver fails to restore agent's checkpoint

我正在通过 AWS Sagemaker 使用 rl coach,但我 运行 遇到了一个我难以理解的问题。

我在学习方面使用 AWS Sagemaker 执行强化学习,在环境中使用 AWS Robomaker,就像 DeepRacer which uses rl coach as well. In fact, the code only little differs with the DeepRacer code 在学习方面一样。但是环境完全不一样了。

会发生什么:

代理引发异常消息:Failed to restore agent's checkpoint: 'main_level/agent/main/online/global_step'

回溯指向 this rl coach module 中发生的错误:

File "/someverylongpath/rl_coach/architectures/tensorflow_components/savers.py", line 93, in <dictcomp>
    for ph, v in zip(self._variable_placeholders, self._variables)
KeyError: 'main_level/agent/main/online/global_step'

我像 Deepracer 一样使用 patch on rl coach。 补丁中值得注意的一件事是:

-        self._variables = tf.global_variables()
+        self._variables = tf.trainable_variables()

但是它不应该导致 'main_level/agent/main/online/global_step' 不在 self._variables 中吗? 我认为的问题是 global_step 在 self._variables 中,它不应该在那里。

所以,关于这个问题,有几件事我不明白,而且我不习惯 rl 教练,所以任何帮助都是有价值的。

  1. 为什么第二次失败了? (图管理器是否更改计算图?)
  2. 如何避免global_step进入self._variables?

更多信息:

我删除了补丁(从技术上讲,我删除了正在应用它的 dockerfile 中的补丁命令),现在它可以工作了,模型已从检查点正确恢复。