From 559969d3dd77bbff356c438105ad15a92bec4a7d Mon Sep 17 00:00:00 2001 From: shadiendrawis <40395873+shadiendrawis@users.noreply.github.com> Date: Thu, 22 Nov 2018 18:15:52 +0200 Subject: [PATCH] disabled loading for target weights (#138) * Update savers.py * disabled loading for target weights --- rl_coach/architectures/tensorflow_components/savers.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rl_coach/architectures/tensorflow_components/savers.py b/rl_coach/architectures/tensorflow_components/savers.py index bb3ab19..4f30fe5 100644 --- a/rl_coach/architectures/tensorflow_components/savers.py +++ b/rl_coach/architectures/tensorflow_components/savers.py @@ -11,6 +11,10 @@ class GlobalVariableSaver(Saver): # if graph is finalized, savers must have already already been added. This happens # in the case of a MonitoredSession self._variables = tf.global_variables() + + # target network is never saved or restored directly from checkpoint, so we are removing all its variables from the list + # the target network would be synched back from the online network in graph_manager.improve(...), at the beginning of the run flow. + self._variables = [v for v in self._variables if '/target' not in v.name] self._saver = tf.train.Saver(self._variables) @property