tf.summary.initialize
Stay organized with collections
Save and categorize content based on your preferences.
Initializes summary writing for graph execution mode.
tf.summary.initialize(
graph=None, session=None
)
This operation is a no-op when executing eagerly.
This helper method provides a higher-level alternative to using
tf.contrib.summary.summary_writer_initializer_op
and
tf.contrib.summary.graph
.
Most users will also want to call tf.compat.v1.train.create_global_step
which can happen before or after this function is called.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.summary.initialize\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/summary_ops_v2.py#L291-L330) |\n\nInitializes summary writing for graph execution mode.\n\n#### View aliases\n\n\n**Main aliases**\n\n\\`tf.contrib.summary.initialize\\`\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.summary.initialize`](/api_docs/python/tf/compat/v1/summary/initialize)\n\n\u003cbr /\u003e\n\n tf.summary.initialize(\n graph=None, session=None\n )\n\nThis operation is a no-op when executing eagerly.\n\nThis helper method provides a higher-level alternative to using\n[`tf.contrib.summary.summary_writer_initializer_op`](../../tf/contrib/summary/summary_writer_initializer_op) and\n[`tf.contrib.summary.graph`](../../tf/contrib/summary/graph).\n\nMost users will also want to call [`tf.compat.v1.train.create_global_step`](../../tf/train/create_global_step)\nwhich can happen before or after this function is called.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `graph` | A [`tf.Graph`](../../tf/Graph) or [`tf.compat.v1.GraphDef`](../../tf/GraphDef) to output to the writer. This function will not write the default graph by default. When writing to an event log file, the associated step will be zero. |\n| `session` | So this method can call [`tf.Session.run`](../../tf/Session#run). This defaults to [`tf.compat.v1.get_default_session`](../../tf/get_default_session). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|----------------|----------------------------------------------------------------------------------------------------------------------|\n| `RuntimeError` | If the current thread has no default [`tf.contrib.summary.SummaryWriter`](../../tf/compat/v2/summary/SummaryWriter). |\n| `ValueError` | If session wasn't passed and no default session. |\n\n\u003cbr /\u003e"]]