From 00a4b961985f5fc258dd055a20e59163db3bd386 Mon Sep 17 00:00:00 2001 From: JaehunRyu Date: Sun, 9 Feb 2020 23:09:04 +0900 Subject: [PATCH 1/7] Fixed FileWriter docs and raise msg --- tensorflow/python/summary/writer/writer.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/tensorflow/python/summary/writer/writer.py b/tensorflow/python/summary/writer/writer.py index e171a9ed2c3..87d1b625449 100644 --- a/tensorflow/python/summary/writer/writer.py +++ b/tensorflow/python/summary/writer/writer.py @@ -291,7 +291,7 @@ class FileWriter(SummaryToEventTransformer): When constructed with a `tf.compat.v1.Session` parameter, a `FileWriter` instead forms a compatibility layer over new graph-based summaries - (`tf.contrib.summary`) to facilitate the use of new summary writing with + to facilitate the use of new summary writing with pre-existing code that expects a `FileWriter` instance. This class is not thread-safe. @@ -328,15 +328,8 @@ class FileWriter(SummaryToEventTransformer): ``` The `session` argument to the constructor makes the returned `FileWriter` a - compatibility layer over new graph-based summaries (`tf.contrib.summary`). - Crucially, this means the underlying writer resource and events file will - be shared with any other `FileWriter` using the same `session` and `logdir`, - and with any `tf.contrib.summary.SummaryWriter` in this session using the - the same shared resource name (which by default scoped to the logdir). If - no such resource exists, one will be created using the remaining arguments - to this constructor, but if one already exists those arguments are ignored. - In either case, ops will be added to `session.graph` to control the - underlying file writer resource. See `tf.contrib.summary` for more details. + compatibility layer over new graph-based summaries. + Args: logdir: A string. Directory where event file will be written. @@ -354,13 +347,13 @@ class FileWriter(SummaryToEventTransformer): @compatibility(eager) `FileWriter` is not compatible with eager execution. To write TensorBoard - summaries under eager execution, use `tf.contrib.summary` instead. + summaries under eager execution, use `tf.compat.v1.disable_eager_execution()` before the code. @end_compatibility """ if context.executing_eagerly(): raise RuntimeError( "tf.summary.FileWriter is not compatible with eager execution. " - "Use tf.contrib.summary instead.") + "Use `tf.compat.v1.disable_eager_execution()` before the code") if session is not None: event_writer = EventFileWriterV2( session, logdir, max_queue, flush_secs, filename_suffix) From 4d9e067fae2971ce6f8a3e90ab9a2e608cc60415 Mon Sep 17 00:00:00 2001 From: Mark Daoust Date: Sun, 9 Feb 2020 07:44:19 -0800 Subject: [PATCH 2/7] Update writer.py --- tensorflow/python/summary/writer/writer.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tensorflow/python/summary/writer/writer.py b/tensorflow/python/summary/writer/writer.py index 87d1b625449..cce21f86b28 100644 --- a/tensorflow/python/summary/writer/writer.py +++ b/tensorflow/python/summary/writer/writer.py @@ -328,8 +328,11 @@ class FileWriter(SummaryToEventTransformer): ``` The `session` argument to the constructor makes the returned `FileWriter` a - compatibility layer over new graph-based summaries. - + compatibility layer over new graph-based summaries (`tf.summary`). + Crucially, this means the underlying writer resource and events file will + be shared with any other `FileWriter` using the same `session` and `logdir`. + In either case, ops will be added to `session.graph` to control the + underlying file writer resource. Args: logdir: A string. Directory where event file will be written. @@ -346,14 +349,14 @@ class FileWriter(SummaryToEventTransformer): RuntimeError: If called with eager execution enabled. @compatibility(eager) - `FileWriter` is not compatible with eager execution. To write TensorBoard - summaries under eager execution, use `tf.compat.v1.disable_eager_execution()` before the code. + `v1.summary.FileWriter` is not compatible with eager execution. To write TensorBoard + summaries under eager execution, use `tf.summary.create_file_writer`. @end_compatibility """ if context.executing_eagerly(): raise RuntimeError( - "tf.summary.FileWriter is not compatible with eager execution. " - "Use `tf.compat.v1.disable_eager_execution()` before the code") + "v1.summary.FileWriter is not compatible with eager execution. " + "Use `tf.summary.create_file_writer`") if session is not None: event_writer = EventFileWriterV2( session, logdir, max_queue, flush_secs, filename_suffix) From 2c3bd0f697ee828a097f6147c91f97fbad277f70 Mon Sep 17 00:00:00 2001 From: Mark Daoust Date: Sun, 9 Feb 2020 07:46:17 -0800 Subject: [PATCH 3/7] Update writer.py --- tensorflow/python/summary/writer/writer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tensorflow/python/summary/writer/writer.py b/tensorflow/python/summary/writer/writer.py index cce21f86b28..1dffd2e5b75 100644 --- a/tensorflow/python/summary/writer/writer.py +++ b/tensorflow/python/summary/writer/writer.py @@ -350,13 +350,14 @@ class FileWriter(SummaryToEventTransformer): @compatibility(eager) `v1.summary.FileWriter` is not compatible with eager execution. To write TensorBoard - summaries under eager execution, use `tf.summary.create_file_writer`. + summaries under eager execution, use `tf.summary.create_file_writer` or a + `with v1.Graph.as_default():` context. @end_compatibility """ if context.executing_eagerly(): raise RuntimeError( "v1.summary.FileWriter is not compatible with eager execution. " - "Use `tf.summary.create_file_writer`") + "Use `tf.summary.create_file_writer`, or a `with v1.Graph.as_default():` context") if session is not None: event_writer = EventFileWriterV2( session, logdir, max_queue, flush_secs, filename_suffix) From d7e98863ddd36f0de30125e89991a1faaf80e266 Mon Sep 17 00:00:00 2001 From: Mark Daoust Date: Sun, 9 Feb 2020 08:50:11 -0800 Subject: [PATCH 4/7] Update writer.py --- tensorflow/python/summary/writer/writer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tensorflow/python/summary/writer/writer.py b/tensorflow/python/summary/writer/writer.py index 1dffd2e5b75..cdced098db8 100644 --- a/tensorflow/python/summary/writer/writer.py +++ b/tensorflow/python/summary/writer/writer.py @@ -329,9 +329,9 @@ class FileWriter(SummaryToEventTransformer): The `session` argument to the constructor makes the returned `FileWriter` a compatibility layer over new graph-based summaries (`tf.summary`). - Crucially, this means the underlying writer resource and events file will + Crucially, this means the underlying writer resource and events file will be shared with any other `FileWriter` using the same `session` and `logdir`. - In either case, ops will be added to `session.graph` to control the + In either case, ops will be added to `session.graph` to control the underlying file writer resource. Args: @@ -351,13 +351,13 @@ class FileWriter(SummaryToEventTransformer): @compatibility(eager) `v1.summary.FileWriter` is not compatible with eager execution. To write TensorBoard summaries under eager execution, use `tf.summary.create_file_writer` or a - `with v1.Graph.as_default():` context. + `with v1.Graph().as_default():` context. @end_compatibility """ if context.executing_eagerly(): raise RuntimeError( "v1.summary.FileWriter is not compatible with eager execution. " - "Use `tf.summary.create_file_writer`, or a `with v1.Graph.as_default():` context") + "Use `tf.summary.create_file_writer`, or a `with v1.Graph().as_default():` context") if session is not None: event_writer = EventFileWriterV2( session, logdir, max_queue, flush_secs, filename_suffix) From 1022952737e2ae810b8b020b6d9f02cb5c55dee3 Mon Sep 17 00:00:00 2001 From: JaehunRyu Date: Tue, 11 Feb 2020 14:28:13 +0900 Subject: [PATCH 5/7] Update text length for pylint error --- configure | 2 +- tensorflow/python/summary/writer/writer.py | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 66b66ba54ed..7a299f3e274 100755 --- a/configure +++ b/configure @@ -4,7 +4,7 @@ set -e set -o pipefail if [ -z "$PYTHON_BIN_PATH" ]; then - PYTHON_BIN_PATH=$(which python || which python3 || true) + PYTHON_BIN_PATH=$( which python3 || true) fi # Set all env variables diff --git a/tensorflow/python/summary/writer/writer.py b/tensorflow/python/summary/writer/writer.py index cdced098db8..5b06820abd9 100644 --- a/tensorflow/python/summary/writer/writer.py +++ b/tensorflow/python/summary/writer/writer.py @@ -349,15 +349,17 @@ class FileWriter(SummaryToEventTransformer): RuntimeError: If called with eager execution enabled. @compatibility(eager) - `v1.summary.FileWriter` is not compatible with eager execution. To write TensorBoard - summaries under eager execution, use `tf.summary.create_file_writer` or a - `with v1.Graph().as_default():` context. + `v1.summary.FileWriter` is not compatible with eager execution. + To write TensorBoard summaries under eager execution, + use `tf.summary.create_file_writer` or + a `with v1.Graph().as_default():` context. @end_compatibility """ if context.executing_eagerly(): raise RuntimeError( "v1.summary.FileWriter is not compatible with eager execution. " - "Use `tf.summary.create_file_writer`, or a `with v1.Graph().as_default():` context") + "Use `tf.summary.create_file_writer`," + "or a `with v1.Graph().as_default():` context") if session is not None: event_writer = EventFileWriterV2( session, logdir, max_queue, flush_secs, filename_suffix) From 85690a9dae5e6e72ed52a02270659e5ce9f9ec3d Mon Sep 17 00:00:00 2001 From: JaehunRyu <2013103902@khu.ac.kr> Date: Sat, 22 Feb 2020 18:54:09 +0900 Subject: [PATCH 6/7] Fixex some error --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 7a299f3e274..66b66ba54ed 100755 --- a/configure +++ b/configure @@ -4,7 +4,7 @@ set -e set -o pipefail if [ -z "$PYTHON_BIN_PATH" ]; then - PYTHON_BIN_PATH=$( which python3 || true) + PYTHON_BIN_PATH=$(which python || which python3 || true) fi # Set all env variables From 142d271f014953d8f3cb5dac7cfac1e224e84d17 Mon Sep 17 00:00:00 2001 From: Mark Daoust Date: Thu, 5 Mar 2020 05:54:47 -0800 Subject: [PATCH 7/7] Fix ubuntu sanity-check --- tensorflow/python/summary/writer/writer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/python/summary/writer/writer.py b/tensorflow/python/summary/writer/writer.py index 5b06820abd9..889f71bc669 100644 --- a/tensorflow/python/summary/writer/writer.py +++ b/tensorflow/python/summary/writer/writer.py @@ -359,7 +359,7 @@ class FileWriter(SummaryToEventTransformer): raise RuntimeError( "v1.summary.FileWriter is not compatible with eager execution. " "Use `tf.summary.create_file_writer`," - "or a `with v1.Graph().as_default():` context") + "or a `with v1.Graph().as_default():` context") if session is not None: event_writer = EventFileWriterV2( session, logdir, max_queue, flush_secs, filename_suffix)