Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Community Manager
279 Views

Problems Compiling

Hi there,

 

I depeloped a simple model on the mnist data, saved it, and got the files .data-00000-of-00001, index, meta and checkpoint. Now, I wanted to compiled it using mvNCCompile. On the command like I run: mvNCCompile my_model.ckpt.meta -in input -on accuracy. But is giving me this error message:

 

/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/tf_inspect.py:45: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead

 

if d.decorator_argspec is not None), _inspect.getargspec(target))

 

/usr/lib/python3/dist-packages/pandas/init.py:7: DeprecationWarning: bad escape \s

 

from pandas import hashtable, tslib, lib

 

[Error 34] Setup Error: Values for input contain placeholder. Pass an absolute value.

 

Just for the sake of completion, here is the code I use to generate those files:

 

import tensorflow as tf

 

from tensorflow.examples.tutorials.mnist import input_data

 

mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)

 

learning_rate = 0.5

 

epochs = 1

 

batch_size = 100

 

input = tf.placeholder(tf.float32, [None, 784],name="input")

 

output = tf.placeholder(tf.float32, [None, 10],name="output")

 

W1 = tf.Variable(tf.random_normal([784, 300], stddev=0.03), name='W1')

 

b1 = tf.Variable(tf.random_normal([300]), name='b1')

 

W2 = tf.Variable(tf.random_normal([300, 10], stddev=0.03), name='W2')

 

b2 = tf.Variable(tf.random_normal([10]), name='b2')

 

hidden_out = tf.add(tf.matmul(input, W1), b1)

 

hidden_out = tf.nn.relu(hidden_out)

 

y_ = tf.nn.softmax(tf.add(tf.matmul(hidden_out, W2), b2))

 

y_clipped = tf.clip_by_value(y_, 1e-10, 0.9999999) # garantir que nao temos um valor de y_ = 0 o que depois rebentava com o logaritmo

 

cross_entropy = -tf.reduce_mean(tf.reduce_sum(output * tf.log(y_clipped)

 

+ (1 - output) * tf.log(1 - y_clipped), axis=1))

 

optimiser = tf.train.GradientDescentOptimizer(learning_rate=learning_rate).minimize(cross_entropy)

 

init_op = tf.global_variables_initializer()

 

correct_prediction = tf.equal(tf.argmax(output, 1), tf.argmax(y_, 1))

 

accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32),name="accuracy")

 

saver = tf.train.Saver(max_to_keep=1)

 

with tf.Session() as sess:

 

sess.run(init_op) total_batch = int(len(mnist.train.labels) / batch_size) for epoch in range(epochs): avg_cost = 0 for i in range(total_batch): batch_x, batch_y = mnist.train.next_batch(batch_size=batch_size) _, c = sess.run([optimiser, cross_entropy], feed_dict={input: batch_x, output: batch_y}) avg_cost += c / total_batch print("Epoch:", (epoch + 1), "cost =", "{:.3f}".format(avg_cost)) savePath = saver.save(sess, 'my_model.ckpt')

 

Can you please help me? My goal is to export the trained model to the NCS and then run it on some example to get the classification output.

 

Tahnk you in advance

Tags (1)
0 Kudos
2 Replies
Highlighted
Community Manager
23 Views

@franciscoferreira34 Thanks for providing your code and files for testing. I was able to reproduce your issue and we are looking into the cause of the issue. Thanks for your patience.

0 Kudos
Highlighted
Community Manager
23 Views

@franciscoferreira34 Can you try modifying the placeholder similar to what I recommended @ https://ncsforum.movidius.com/discussion/536/error-34-values-for-input-contain-placeholder#latest and let me know if this works for you? Thanks.

0 Kudos