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!

Compiling a tensorflow graph using mvNCCompile

Hello, I am trying to use mvNCCompile to compile a Tensorflow model. I am facing a compile error. The tensorflow model runs correctly under tensorflow 1.5 and 1.4. Error message (got also the same message using mvNCCheck):

Traceback (most recent call last):
File "/usr/local/bin/mvNCCheck", line 199, 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 166, in check_net
load_ret = load_network(args, parser, myriad_config)
File "/usr/local/bin/ncsdk/Controllers/Scheduler.py", line 82, in load_network
parse_ret = parse_tensor(arguments, myriad_conf)
File "/usr/local/bin/ncsdk/Controllers/TensorFlowParser.py", line 1132, in parse_tensor
[a_input[0], a_input[1], a_input[2], concat_channel_size])
File "/home/rami/.local/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 466, in set_shape
self._shape = self._shape.merge_with(shape) # pylint: disable=protected-access
File "/home/rami/.local/lib/python3.5/site-packages/tensorflow/python/framework/tensor_shape.py", line 582, in merge_with
raise ValueError("Shapes %s and %s are not compatible" % (self, other))
ValueError: Shapes (1, 1, 8) and (1, 1, 4, 0) are not compatible

Is there is a way for mvNCCompile to point at least the tensor name causing the "error" ?

Can you please also point a reference on what is actually supported in TensorFlow by mvNCCompile ?? I have checked the release notes at https://movidius.github.io/ncsdk/release_notes.html and it is **not clear **concerning tensorflow.

Also, thank you for providing reference for the command line options of mvNCCompile, there are some options without documentation.

-ec Force explicit concat
--accuracy_adjust [ACCURACY_ADJUST]
Scale the output by this amount
--ma2480 Dev flag
--scheduler SCHEDULER
Dev flag
--new-parser Dev flag

Thank you for advice.

Comments

  • 9 Comments sorted by Votes Date Added
  • @rami_ka Looks like the issue is with the concat operation. I don't have your network, but I'm guessing the your model is using the concat operation to concatenate two tensors with shape (1,1,4,0) together into a new tensor with shape (1,1,8) and it looks like maybe one dimension is missing. Maybe the resulting shape should be (1,1,8,0).

    All options with the Dev flag description are flags that are in development and are not ready for consumer use yet. More information for the mvNCCompile tool can be found at https://movidius.github.io/ncsdk/tools/compile.html

  • Hello, Thanks for the feedback. I am investigating the issue. In fact I did switch the TensorflowParser to debug mode [changed debug to True in /ncsdk/Controllers/TensorFlowParser.py]. I think I found the operation for which ncsdk is reporting an error. it is a simple concat operation. Can you confirm if NCSDK support also arg_max tensorflow operation?

  • Now I am getting
    [Error 5] Toolkit Error: Stage Details Not Supported: Unpack

    What are the tensorflow functions that your sdk actually support ?

  • @rami_ka All data-modifying TensorFlow op implementations can be found in TensorFlowParser.py. When adding TensorFlow support for the NCSDK, we decided to start with a handful of networks and focused on creating support for these networks first (for example: mobilenet variants, inception variants, tiny yolo v2, etc.).

  • edited June 15 Vote Up0Vote Down

    Hello,
    Maybe there is a bug in concat...

    • I added the condition -commented below-, and the script stopped crashing on that section. Anyway I don't know, what is the effect of that. Reading your code, It seems that your SDK only support concat according to the 4'th dimension? Can you confirm that?
    • After adding the condition I am having
      FCL / MatMul
      [Error 5] Toolkit Error: Stage Details Not Supported: Top Not Found /strided_slice

    • There is missing import tf.contrib.summary that is necessary when loading tf.contrib.rnn.LSTMBlockCell. This is kind of tensorflow 1.6 "bug". So your mvNCCompile is failing to import a graph with LSTMBlockCell

  • edited June 15 Vote Up0Vote Down
            elif (node.type == "Concat" or node.type == "ConcatV2") and not node.inputs[0].dtype.is_integer:
                if debug:
                    print("Concat")
                concat_channel_size = 0
                inputs = node.inputs
                for src in inputs:
                    if len(src.get_shape()) >= 4:
                        concat_channel_size += int(src.get_shape()[3])
                a_input = node.inputs[1].get_shape()
                if(concat_channel_size != 0):# added condition
                    node.outputs[0].set_shape(
                        [a_input[0], a_input[1], a_input[2], concat_channel_size])
    
  • Ok I understand the limited support totally. But what is missing in my opinion is the specification of the operations you support in Tensorflow. As a developer I cannot go and examine all the networks you support to find out what operation is supported and which is not, with what conditions and limitations. You have to provide such list of operations and limitations so a developer can correctly target your sdk.

  • @rami_ka We completely understand your point of view. We are working on creating the best experience for our users and appreciate your feedback. Thank you.

  • @rami_ka Are you running version 1 or the latest version 2?
    I can't even get my version to start to compile.

Sign In or Register to comment.