Commit d38d22bf authored by Yuxin Wu's avatar Yuxin Wu

keep the '-summary' suffix

parent b0297e64
......@@ -2,6 +2,11 @@ Bug Reports/Feature Requests/Usage Questions Only:
Bug Reports:
Some part of code (either the library or examples) doesn't work as expected.
Always include the following:
1. What you did. (command you run if using examples; post or describe your code if not)
2. What you observed. (training logs)
3. What you expected, if not obvious
4. Your environment (TF version, GPUs), if it matters.
Feature Requests:
1. Improve an existing feature.
......
......@@ -130,7 +130,8 @@ class Monitors(Callback):
if val.WhichOneof('value') == 'simple_value':
val.tag = re.sub('tower[0-9]+/', '', val.tag) # TODO move to subclasses
# TODO This hack not needed any more, can remove this in the future
# TODO This hack is still needed, seem to disappear only when
# compiled from source.
suffix = '-summary' # tensorflow#6150, tensorboard#59
if val.tag.endswith(suffix):
val.tag = val.tag[:-len(suffix)]
......
......@@ -41,6 +41,7 @@ def regularize_cost(regex, func, name='regularize_cost'):
cost = cost + regularize_cost("fc.*/W", l2_regularizer(1e-5))
"""
assert len(regex)
ctx = get_current_tower_context()
if not ctx.is_training:
# Currently cannot build the wd_cost correctly at inference,
......
......@@ -119,8 +119,8 @@ def add_tensor_summary(x, types, name=None, collections=None,
return
SUMMARY_TYPES_DIC = {
'scalar': lambda: tf.summary.scalar(name, x, collections=collections),
'histogram': lambda: tf.summary.histogram(name, x, collections=collections),
'scalar': lambda: tf.summary.scalar(name + '-summary', x, collections=collections),
'histogram': lambda: tf.summary.histogram(name + '-histogram', x, collections=collections),
'sparsity': lambda: tf.summary.scalar(
name + '-sparsity', tf.nn.zero_fraction(x),
collections=collections),
......@@ -246,7 +246,7 @@ def add_moving_summary(*args, **kwargs):
ema_ops.append(ema_op)
with tf.name_scope(None):
# cannot add it into colocate group -- will force everything to cpus
tf.summary.scalar(name, ema_op) # write the EMA value as a summary
tf.summary.scalar(name + '-summary', ema_op) # write the EMA value as a summary
if coll is not None:
for op in ema_ops:
# TODO a new collection to summary every step?
......
......@@ -7,5 +7,6 @@ exclude = .git,
snippet,
docs,
examples,
examples-old,
_test.py,
docs/conf.py
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