By names I\'m referring to:
tf.placeholder(tf.float32, name=\'NAME\')
tf.get_variable(\"W\", [n_in, n_out],initializer=w_init())
I have sev
First of all, you can get the placeholder using tf.Graph.get_tensor_by_name(). For example, assuming that you are working with the default graph:
placeholder1 = tf.placeholder(tf.float32, name='NAME')
placeholder2 = tf.get_default_graph().get_tensor_by_name('NAME:0')
assert placeholder1 == placeholder2
Secondly, I would use the following function to get all variables with a given name (no matter their scope):
def get_all_variables_with_name(var_name):
name = var_name + ':0'
return [var for var in tf.all_variables() if var.name.endswith(name)]