Remove ':' from summary names in optimize_loss.

Change: 137974467
This commit is contained in:
A. Unique TensorFlower 2016-11-02 10:55:55 -08:00 committed by TensorFlower Gardener
parent 60d5d28ae2
commit 2f8318865e
2 changed files with 5 additions and 5 deletions

View File

@ -258,10 +258,11 @@ def optimize_loss(loss,
grad_values = gradient
if grad_values is not None:
var_name = variable.name.replace(":", "_")
if "gradients" in summaries:
summary.histogram("gradients/" + variable.name, grad_values)
summary.histogram("gradients/%s" % var_name, grad_values)
if "gradient_norm" in summaries:
summary.scalar("gradient_norm/" + variable.name,
summary.scalar("gradient_norm/%s" % var_name,
clip_ops.global_norm([grad_values]))
if clip_gradients is not None and "gradient_norm" in summaries:

View File

@ -35,8 +35,6 @@ from __future__ import print_function
import re as _re
import six
from google.protobuf import json_format as _json_format
from tensorflow.core.framework import summary_pb2 as _summary_pb2
from tensorflow.python.framework import dtypes as _dtypes
@ -47,8 +45,8 @@ from tensorflow.python.ops import gen_logging_ops as _gen_logging_ops
from tensorflow.python.ops.summary_ops import tensor_summary
# pylint: enable=unused-import
from tensorflow.python.platform import tf_logging as _logging
from tensorflow.python.util.all_util import remove_undocumented
from tensorflow.python.util import compat as _compat
from tensorflow.python.util.all_util import remove_undocumented
def _collect(val, collections, default_collections):
@ -60,6 +58,7 @@ def _collect(val, collections, default_collections):
_INVALID_TAG_CHARACTERS = _re.compile(r'[^-/\w\.]')
def _clean_tag(name):
# In the past, the first argument to summary ops was a tag, which allowed
# arbitrary characters. Now we are changing the first argument to be the node