forked from tensorflow/tensorflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding summaries to the resnet example.
Also utilities to use summaries in graph mode. PiperOrigin-RevId: 173483424
- Loading branch information
1 parent
6149fec
commit ff7b9a6
Showing
10 changed files
with
182 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ set(tf_op_lib_names | |
"state_ops" | ||
"stateless_random_ops" | ||
"string_ops" | ||
"summary_ops" | ||
"training_ops" | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ============================================================================== | ||
|
||
"""Contrib summary package. | ||
The operations in this package are safe to use with eager execution turned or on | ||
off. | ||
""" | ||
|
||
from __future__ import absolute_import | ||
from __future__ import division | ||
from __future__ import print_function | ||
|
||
# pylint: disable=unused-import | ||
from tensorflow.contrib.summary.summary_ops import all_summary_ops | ||
from tensorflow.contrib.summary.summary_ops import always_record_summaries | ||
from tensorflow.contrib.summary.summary_ops import audio | ||
from tensorflow.contrib.summary.summary_ops import create_summary_file_writer | ||
from tensorflow.contrib.summary.summary_ops import generic | ||
from tensorflow.contrib.summary.summary_ops import histogram | ||
from tensorflow.contrib.summary.summary_ops import image | ||
from tensorflow.contrib.summary.summary_ops import never_record_summaries | ||
from tensorflow.contrib.summary.summary_ops import record_summaries_every_n_global_steps | ||
from tensorflow.contrib.summary.summary_ops import scalar | ||
from tensorflow.contrib.summary.summary_ops import should_record_summaries | ||
from tensorflow.contrib.summary.summary_ops import summary_writer_initializer_op |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# ============================================================================== | ||
|
||
"""Utilities to test summaries.""" | ||
|
||
from __future__ import absolute_import | ||
from __future__ import division | ||
from __future__ import print_function | ||
|
||
import os | ||
|
||
from tensorflow.core.util import event_pb2 | ||
from tensorflow.python.lib.io import tf_record | ||
from tensorflow.python.platform import gfile | ||
|
||
|
||
def events_from_file(logdir): | ||
"""Returns all events in the single eventfile in logdir.""" | ||
assert gfile.Exists(logdir) | ||
files = gfile.ListDirectory(logdir) | ||
assert len(files) == 1, "Found more than one file in logdir: %s" % files | ||
records = list( | ||
tf_record.tf_record_iterator(os.path.join(logdir, files[0]))) | ||
result = [] | ||
for r in records: | ||
event = event_pb2.Event() | ||
event.ParseFromString(r) | ||
result.append(event) | ||
return result |
Oops, something went wrong.