learn_ml icon indicating copy to clipboard operation
learn_ml copied to clipboard

[error]mvNCCheck TF_Model/tf_model.meta -in=conv2d_1_input -on=dense_2/Softmax

Open hskzlj opened this issue 6 years ago • 9 comments

$ mvNCCheck TF_Model/tf_model.meta -in=conv2d_1_input -on=dense_2/Softmax mvNCCheck v02.00, Copyright @ Movidius Ltd 2016

Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/client/session.py", line 1323, in _do_call return fn(*args) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/client/session.py", line 1302, in _run_fn status, run_metadata) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/errors_impl.py", line 473, in exit c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'conv2d_1_input' with dtype float [[Node: conv2d_1_input = Placeholderdtype=DT_FLOAT, shape=[], _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/mvNCCheck", line 152, in quit_code = check_net(args.network, args.image, args.inputnode, args.outputnode, args.nshaves, args.inputsize, args.weights, args) File "/usr/local/bin/mvNCCheck", line 130, in check_net net = parse_tensor(args, myriad_config, file_gen=True) File "/usr/local/bin/ncsdk/Controllers/TensorFlowParser.py", line 1059, in parse_tensor desired_shape = node.inputs[1].eval() File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py", line 570, in eval return _eval_using_default_session(self, feed_dict, self.graph, session) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py", line 4455, in _eval_using_default_session return session.run(tensors, feed_dict) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/client/session.py", line 889, in run run_metadata_ptr) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/client/session.py", line 1120, in _run feed_dict_tensor, options, run_metadata) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/client/session.py", line 1317, in _do_run options, run_metadata) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/client/session.py", line 1336, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'conv2d_1_input' with dtype float [[Node: conv2d_1_input = Placeholderdtype=DT_FLOAT, shape=[], _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

Caused by op 'conv2d_1_input', defined at: File "/usr/local/bin/mvNCCheck", line 152, in quit_code = check_net(args.network, args.image, args.inputnode, args.outputnode, args.nshaves, args.inputsize, args.weights, args) File "/usr/local/bin/mvNCCheck", line 130, in check_net net = parse_tensor(args, myriad_config, file_gen=True) File "/usr/local/bin/ncsdk/Controllers/TensorFlowParser.py", line 213, in parse_tensor saver = tf.train.import_meta_graph(path, clear_devices=True) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/training/saver.py", line 1810, in import_meta_graph **kwargs) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/meta_graph.py", line 660, in import_scoped_meta_graph producer_op_list=producer_op_list) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/importer.py", line 313, in import_graph_def op_def=op_def) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py", line 2956, in create_op op_def=op_def) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py", line 1470, in init self._traceback = self._graph._extract_stack() # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'conv2d_1_input' with dtype float [[Node: conv2d_1_input = Placeholderdtype=DT_FLOAT, shape=[], _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

hskzlj avatar Jun 26 '18 03:06 hskzlj

You need a modified TensorFlowParser.py.

oraoto avatar Aug 04 '18 08:08 oraoto

hi, brother but how to use TensorFlowParser.py to convert into graph when i want to convert your model after training they give me the same error. commond for converting: mvNCCompile TF_Model/tf_model.meta -in=conv2d_1_input -on=dense_2/Softmax give me error: InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'conv2d_1_input' with dtype float and shape [?,28,28,1] [[Node: conv2d_1_input = Placeholderdtype=DT_FLOAT, shape=[?,28,28,1], _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

Altaf-hucn avatar May 05 '19 09:05 Altaf-hucn

@Altaf-hucn Simply replace the bundled TensorFlowParser.py in ncsdk with this one.

oraoto avatar May 06 '19 10:05 oraoto

Thanks for reply, sir i search all folders of ncsdk but i'm confused on what bundled i replace TensorFlowParser.py. if you don't mind please tell me step by step

Altaf-hucn avatar May 06 '19 16:05 Altaf-hucn

In NCSDK 2.05.00.02, it's located in /opt/movidius/NCSDK/ncsdk-x86_64/tk/Controllers/Parsers/TensorFlow.py .

Notice that my modified TensorFlowParser.py predates NCSDK 2.05.00.02, and may not work with it.

oraoto avatar May 06 '19 16:05 oraoto

It's in /opt/movidius/NCSDK/ncsdk-x86_64/tk/Controllers/TensorFlowParser.py.

oraoto avatar May 06 '19 16:05 oraoto

Dear @oraoto i update my TensorFlowParser.py but again it did'nt work. In my laptop currently i install NCSDK version 1 in ubuntu 16.04. please give me some suggestion?

Altaf-hucn avatar May 06 '19 19:05 Altaf-hucn

Sorry, i don't have NCSDK 1 installation right now, maybe you should try NCSDK 2.

oraoto avatar May 13 '19 04:05 oraoto

Dear i install NCSDK2 and train your coded model again and also change TensorflowParser.py, but again shown the same error, Brother if you don't mind please tell me about your setup or please run your code and convert yourself. Sir you carefully read the ncsdk/examples/tensorflow/inception_v1/inception-v1.py ncsdk code , in the code they pass a placeholder.

#! /usr/bin/env python3 import numpy as np import tensorflow as tf

from tensorflow.contrib.slim.nets import inception slim = tf.contrib.slim def run(name, image_size, num_classes): with tf.Graph().as_default(): image = tf.placeholder("float", [1, image_size, image_size, 3], name="input") with slim.arg_scope(inception.inception_v1_arg_scope()): logits, _ = inception.inception_v1(image, num_classes, is_training=False, spatial_squeeze=False) probabilities = tf.nn.softmax(logits) init_fn = slim.assign_from_checkpoint_fn('inception_v1.ckpt', slim.get_model_variables('InceptionV1'))

with tf.Session() as sess:
    init_fn(sess)
    saver = tf.train.Saver(tf.global_variables())
    saver.save(sess, "output/"+name)

run('inception-v1', 224, 1001)

Error showing: InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'conv2d_1_input' with dtype float and shape [?,28,28,1] [[{{node conv2d_1_input}} = Placeholderdtype=DT_FLOAT, shape=[?,28,28,1], _device="/job:localhost/replica:0/task:0/device:CPU:0"]]

Altaf-hucn avatar May 13 '19 12:05 Altaf-hucn