Commit 9eaf6e92 authored by Yuxin Wu's avatar Yuxin Wu

freeze UPDATE_OPS in inference tower (#439)

parent 1b27a59b
...@@ -65,7 +65,9 @@ class PredictorFactory(object): ...@@ -65,7 +65,9 @@ class PredictorFactory(object):
with tf.device(device), \ with tf.device(device), \
TowerContext(tower_name, is_training=False), \ TowerContext(tower_name, is_training=False), \
freeze_collection(TOWER_FREEZE_KEYS): freeze_collection(TOWER_FREEZE_KEYS + [tf.GraphKeys.UPDATE_OPS]):
# also freeze UPDATE_OPS in inference, because they should never be used
# TODO a better way to log and warn about collection change during build_graph.
if input is None: if input is None:
input = PlaceholderInput() input = PlaceholderInput()
input.setup(self._model.get_inputs_desc()) input.setup(self._model.get_inputs_desc())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment