Skip to content

Commit 88f209c

Browse files
tf-transform-teamzoyahav
authored andcommitted
Project import generated by Copybara.
PiperOrigin-RevId: 219386646
1 parent 11c45fd commit 88f209c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tensorflow_transform/analyzers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,8 @@ def initialize_local_state(self, tf_config=None):
974974
stamp_token = 0
975975

976976
# Create a new session with a new graph for quantile ops.
977-
self._session = tf.Session(graph=tf.Graph(), config=tf_config)
977+
graph = tf.Graph()
978+
self._session = tf.Session(graph=graph, config=tf_config)
978979
with self._session.graph.as_default():
979980
with self._session.as_default():
980981
self._qaccumulator = quantile_ops.QuantileAccumulator(
@@ -1025,6 +1026,8 @@ def initialize_local_state(self, tf_config=None):
10251026
_, self._buckets_op = self._qaccumulator.get_buckets(
10261027
stamp_token=stamp_token)
10271028

1029+
graph.finalize()
1030+
10281031
# We generate an empty summary by calling self._flush_summary_op.
10291032
# We cache this as some implementations may call create_accumulator for
10301033
# every input, and it can be cached since it will always be the same and

tensorflow_transform/beam/impl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ def __init__(self, saved_model_dir, input_schema, exclude_outputs,
287287
saved_model_dir, {}))
288288
self.session.run(tf.global_variables_initializer())
289289
self.session.run(tf.tables_initializer())
290+
graph.finalize()
290291

291292
input_schema_keys = input_schema.column_schemas.keys()
292293
extra_input_keys = set(input_schema_keys).difference(inputs.keys())

0 commit comments

Comments
 (0)