Remove nodes from graph or reset entire default graph

Remove nodes from graph or reset entire default graph

Asked on December 15, 2018 in Tensorflow.
Add Comment


  • 1 Answer(s)

    For IPython / Jupyter notebook.

    First create a default graph:

    def main():
        # Define your model
        data = tf.placeholder(...)
        model = ...
     
    with tf.Graph().as_default():
        main()
    

    Once it run, the graph is cleared up.

    Answered on December 15, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.