frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Movidius and tensorflow outputs dont match

Hi!
I've build a tensorflow model consisting of two convolutional and two fully connected layers. Then I initialize it with random variables, evaluate it on a np.ones vector and save the model.

input = tf.placeholder("float16", [1, 1604,9,1], name="x")
output  = fc_gest(conv(input)) #output from my model
print(output)
with tf.Session() as sess: 
    sess.run(tf.global_variables_initializer())
    saver = tf.train.Saver(tf.global_variables())
    inp = np.ones((1,1604,9,1),dtype ="float16")
    print('eval: ',np.float16(output.eval({input:inp})))
    saver.save(sess, "./saved_sess/model.ckpts")

this code gives me ''add_3' as the name of my output vector and [[ 3.90820312 5.2890625 6.06640625 3.36328125 -4.046875
-6.26171875 10.546875 ]] a result of passing np.ones to my model.

I then generate a graph file with the command mvNCCompile model.ckpts.meta -in=x -on=add_3

After I get the graph file I load it to the stick and pass the same np.ones vector:

print("allocating graph")
graph = device.AllocateGraph(graphfile)
print("loading tensor")
inp = np.ones(([1,1604,9,1]),dtype ="float16")
graph.LoadTensor(inp, 'x')
print("computing result")
output, userobj = graph.GetResult()
print(np.float16(output))
print(output.shape)

the output of this is
allocating graph
loading tensor
computing result
[ nan nan nan nan nan nan nan]
(7,)

This time it's just nan's. If I make the model smaller it outputs numbers but they still don't match the TF output.
WHY?

Comments

Sign In or Register to comment.