0

I'm trying to get output of the blob

Part of the code:

pool5_= graph.get_tensor_by_name("pool5")
pool5_blob = sess.run([pool5_],
            feed_dict={image_placeholder: utils.image_to_batch(image)})

But I get error:

ValueError: The name 'pool5' refers to an Operation, not a Tensor. Tensor names must be of the form "<op_name>:<output_index>".

pool5 exist in [print(n.name) for n in tf.get_default_graph().as_graph_def().node] and not exist in tf.all_variables().

So if pool5 is operation how to get output blob after operation?

mrgloom
  • 20,061
  • 36
  • 171
  • 301
  • Possible duplicate of [How to use get\_operation\_by\_name() in tensorflow, from a graph built from a different function?](https://stackoverflow.com/questions/45043150/how-to-use-get-operation-by-name-in-tensorflow-from-a-graph-built-from-a-diff) – P-Gn Jul 17 '17 at 17:21

1 Answers1

0

try putting a :0 after the name, like so:

pool5_= graph.get_tensor_by_name("pool5:0")

You can search around as to why this is necessary -- plenty written on it out there by qualified peops...

VS_FF
  • 2,353
  • 3
  • 16
  • 34