I have created a tensor:

tensorX= tf.compat.v1.get_variable("tensorX", dtype=tf.float32,
                                        initializer = tf.compat.v1.constant(100.0))

#.....and when I read this tensor from the graph i.e.

graph = tf.compat.v1.get_default_graph()    
tensorXX = graph.get_tensor_by_name("tensorX:0")

tensorX:0' shape=() dtype=resource 

I have few related questions:

  1. What is dtype=resource in tensorflow(version 2.1)?
  2. While reading this tensor_by_name, why it's returning as "resource"?
  3. Due to its "dtype=resource", Im not able to assign some value to it. How to read this tensor where "dtype=tf.float32 or how to convert "dtype=resource" back to "dtype=tf.float32"?

Thanks in Advance.

  • $\begingroup$ Can you mention the tensorflow version you are using because in tensorflow 1.13.0 it is showing dtype as a float32 $\endgroup$ – Swapnil Pote Jun 9 at 20:29
  • $\begingroup$ I am using version 2.1. $\endgroup$ – vipin bansal Jun 10 at 6:49
  • $\begingroup$ When i am trying on 2.1 it is not working throwing error of tensor does not exist in graph $\endgroup$ – Swapnil Pote Jun 10 at 15:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.