1
0
mirror of https://github.com/gryf/coach.git synced 2025-12-17 19:20:19 +01:00

disabled loading for target weights (#138)

* Update savers.py

* disabled loading for target weights
This commit is contained in:
shadiendrawis
2018-11-22 18:15:52 +02:00
committed by GitHub
parent 949d91321a
commit 559969d3dd

View File

@@ -11,6 +11,10 @@ class GlobalVariableSaver(Saver):
# if graph is finalized, savers must have already already been added. This happens # if graph is finalized, savers must have already already been added. This happens
# in the case of a MonitoredSession # in the case of a MonitoredSession
self._variables = tf.global_variables() 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) self._saver = tf.train.Saver(self._variables)
@property @property