aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/quantize
diff options
context:
space:
mode:
authorGravatar Suharsh Sivakumar <suharshs@google.com>2018-03-19 19:24:26 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-03-19 19:33:23 -0700
commit886df46bdfe89af739ee4f4a81b4c88bbe572c64 (patch)
tree85a2dd084479ecdd7cc906497423724fc12268b2 /tensorflow/contrib/quantize
parentdf9fdc7a74ab5ce786a91c7c62f6ad0d36b24f42 (diff)
Disable freeze_bn_delay by default.
PiperOrigin-RevId: 189680481
Diffstat (limited to 'tensorflow/contrib/quantize')
-rw-r--r--tensorflow/contrib/quantize/python/quantize_graph.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/tensorflow/contrib/quantize/python/quantize_graph.py b/tensorflow/contrib/quantize/python/quantize_graph.py
index be4fc39651..d0fb55da74 100644
--- a/tensorflow/contrib/quantize/python/quantize_graph.py
+++ b/tensorflow/contrib/quantize/python/quantize_graph.py
@@ -99,16 +99,7 @@ def create_training_graph(input_graph=None, quant_delay=0):
# TODO(raghuramank) Need to have freeze_bn_delay be a function of batch size
# Currently the values below are hardcoded for mobilenetV1 on imagenet
# Please use the experimental API if you need to tune these values.
- if quant_delay == 0:
- # Corresponds to case of restoring from a floating point checkpoint
- # In this case, we can freeze the moving mean and variance early on and
- # switch to using them during training. Therefore, freeze_bn_delay is set to
- # 2e5.
- freeze_bn_delay = int(2e5)
- else:
- # If training from scratch, set freeze_bn_delay to 100 epochs after quant
- # delay. With a batch size of 64, this corresponds to 20000*100=2M steps.
- freeze_bn_delay = quant_delay + int(2e6)
+ freeze_bn_delay = None
_create_graph(
input_graph=input_graph,
@@ -142,7 +133,7 @@ def experimental_create_training_graph(input_graph=None,
weight_bits=8,
activation_bits=8,
quant_delay=0,
- freeze_bn_delay=int(2e5)):
+ freeze_bn_delay=None):
"""Rewrites a training input_graph in place for simulated quantization.
Variables added by the rewrite get added to the global variables collection.