tf.compat.v1.reset_default_graph
Clears the default graph stack and resets the global default graph.
tf . compat . v1 . reset_default_graph () -> None
Migrate to TF2
Caution: This API was designed for TensorFlow v1.
Continue reading for details on how to migrate from this API to a native
TensorFlow v2 equivalent. See the
TensorFlow v1 to TensorFlow v2 migration guide
for instructions on how to migrate the rest of your code.
reset_default_graph
does not work with either eager execution or
tf.function
, and you should not invoke it directly. To migrate code that
uses Graph-related functions to TF2, rewrite the code without them. See the
migration guide for more
description about the behavior and semantic changes between Tensorflow 1 and
Tensorflow 2.
Description
Used in the notebooks
Note: The default graph is a property of the current thread. This
function applies only to the current thread. Calling this function while
a tf.compat.v1.Session
or tf.compat.v1.InteractiveSession
is active will
result in undefined
behavior. Using any previously created tf.Operation
or tf.Tensor
objects
after calling this function will result in undefined behavior.
Raises
AssertionError
If this function is called within a nested graph.
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. Some content is licensed under the numpy license .
Last updated 2024-04-26 UTC.
[null,null,["Last updated 2024-04-26 UTC."],[],[]]