Quantcast
Channel: Tensorflow: Cannot interpret feed_dict key as Tensor - Stack Overflow
Viewing all articles
Browse latest Browse all 9

Answer by daoliker for Tensorflow: Cannot interpret feed_dict key as Tensor

$
0
0

Variable x is not in the same graph as model, try to define all of these in the same graph scope. For example,

# define a graph
graph1 = tf.Graph()
with graph1.as_default():
    # placeholder
    x = tf.placeholder(...)
    y = tf.placeholder(...)
    # create model
    model = create(x, w, b)

with tf.Session(graph=graph1) as sess:
# initialize all the variables
sess.run(init)
# then feed_dict
# ......

Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>