Showing results for 
Search instead for 
Did you mean: 
Community Manager

Movidius and tensorflow outputs dont match



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: saver = tf.train.Saver(tf.global_variables()) inp = np.ones((1,1604,9,1),dtype ="float16") print('eval: ',np.float16(output.eval({input:inp}))), "./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]




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.


Tags (1)
0 Kudos
2 Replies
Community Manager

@grisha In order to help debug your problem, I'd like to reproduce the issue you faced. If you could provide a link to the script you used in this post, it would save me a lot of time. Thanks.

0 Kudos
Community Manager

@Tome_at_Intel I have partially solved the problem. I had to exclude addition operation from my graph and reshape it to be a square with three channels.

0 Kudos