You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although this is an old issue, I found nothing about the details of this IS implementation all over the internet.
So mark it here, and hope this could save others' time.
import tensorflow as tf
import os
with tf.gfile.FastGFile('classify_image_graph_def.pb', 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
_ = tf.import_graph_def(graph_def, name='')
sess = tf.Session()
resize_bilinear = sess.graph.get_tensor_by_name('ResizeBilinear:0')
sess.run(resize_bilinear, {'ExpandDims:0': np.ones((1, H, W, 3))}).shape
# output is (1, 299, 299, 3)
Sub = sess.graph.get_tensor_by_name('Sub:0')
sess.run(Sub, {'ExpandDims:0': 255 * np.zeros((1,299,299,3))})
# output is all -128
Mul = sess.graph.get_tensor_by_name('Mul:0')
sess.run(Mul, {'ExpandDims:0': 255 * np.zeros((1,299,299,3))})
# output is all -1
the input of Inception is zero meaned(see part 5in the paper ).
but the code has a condition
assert(np.max(images[0]) > 10)
assert(np.min(images[0]) >= 0.0)
can you explain the difference?
Thanks!
The text was updated successfully, but these errors were encountered: