Remove nodes from graph or reset entire default graph

后端 未结 5 2115
悲&欢浪女
悲&欢浪女 2020-11-28 05:42

When working with the default global graph, is it possible to remove nodes after they\'ve been added, or alternatively to reset the default graph to empty? When working with

5条回答
  •  旧巷少年郎
    2020-11-28 06:30

    Update 11/2/2016

    tf.reset_default_graph()

    Old stuff

    There's reset_default_graph, but not part of public API (I think it should be, does someone wants to file an issue on GitHub?)

    My work-around to reset things is this:

    from tensorflow.python.framework import ops
    ops.reset_default_graph()
    sess = tf.InteractiveSession()
    

提交回复
热议问题