Reputation: 130
I am trying to create a service that evaluates images. To improve performance I am trying to use the same network on all images. I use inference.py as a starting point (https://github.com/hellochick/Indoor-segmentation/blob/master/inference.py) and I moved the net variable to the global scope changing it to:
img_ph = tf.placeholder(tf.float32, shape = [None, None, None, 3])
net = DeepLabResNetModel({'data': img_ph}, is_training=False, num_classes=NUM_CLASSES)
But I get the following error when I evaluate an image:
File "\Python36\lib\site-packages\tensorflow\python\framework\ops.py", line 5573, in _assert_same_graph original_item)) ValueError: Tensor("strided_slice:0", shape=(2,), dtype=int32) must be from the same graph as Tensor("fc_out/Conv2D:0", shape=(?, ?, ?, 27), dtype=float32).
This is running on a Windows server with Python3.
Thanks for any pointers.
Upvotes: 0
Views: 378
Reputation: 130
I found the answer. I was supposed to feed the image when I run the session:
preds = sess.run(pred,feed_dict={img_ph: imgsrc})
Upvotes: 1