Skip to content Skip to sidebar Skip to footer

Changing The Current Graph Of Tf.placeholder Objects In Tensorflow: Is It Possible?

In my code, I am changing my current default graph for some reason and rebuild all the computation logic from scratch. This naturally leads to some errors, since my tf.placeholder

Solution 1:

If you have 2 graphs, you can copy operations and variables from a graph to the other using the tf.contrib.copy_graph module.

In particular, you can use the copy_op_to_graph to copy the placeholder pl from graph g1 to graph g2:

tf.contrib.copy_graph.copy_op_to_graph(
    pl,
    g2,
    [],
    scope=''
)

Post a Comment for "Changing The Current Graph Of Tf.placeholder Objects In Tensorflow: Is It Possible?"