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!

MTCNN ncsdk v2 mvnccompile error


I wish to compile MTCNN graphs from the ncappzoo (sdk v1) for sdk v2. However, when compiling, I get the following error:

making compile
Compiling to create p2838.graph
/usr/local/bin/ncsdk/Controllers/Parsers/TensorFlowParser/ SyntaxWarning: assertion is always true, perhaps remove parentheses?
  assert(False, "Layer type not supported by Convolution: " + obj.type)
mvNCCompile v02.00, Copyright @ Intel Corporation 2017

/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/ DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
shape: (1, 28, 38, 3)
Traceback (most recent call last):
  File "/usr/local/bin/mvNCCompile", line 169, in <module>
    create_graph(, args.image, args.inputnode, args.outputnode, args.outfile, args.nshaves, args.inputsize, args.weights, args.explicit_concat, args.ma2480, args.scheduler, args.new_parser, args)
  File "/usr/local/bin/mvNCCompile", line 148, in create_graph
    load_ret = load_network(args, parser, myriad_config)
  File "/usr/local/bin/ncsdk/Controllers/", line 100, in load_network
    parse_ret = parse_tensor(arguments, myriad_conf)
  File "/usr/local/bin/ncsdk/Controllers/", line 1168, in parse_tensor
    xyz = (1, 1, int(input_shape[1]))
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/", line 521, in __getitem__
    return self._dims[key]
IndexError: list index out of range
Error - Could not compile, not able to create p2838.graph 

Makefile:112: recipe for target 'compile' failed
make: *** [compile] Error 1

I can run and compile other examples fine and I could compile it using sdk v1, so I don't know what the problem is.



  • 6 Comments sorted by Votes Date Added
  • @PINTO
    But why can it be compiled in sdk v1? Was support for some layers dropped?

  • @mdsimmo

    Was support for some layers dropped?

    Probably it is.
    Intel seems to be changing the specifications significantly when upgrading from v1 to v2.
    Many engineers confirmed that MTCNN operates on v1, but also confirmed that v2 does not work.

  • edited October 5 Vote Up0Vote Down

    So the code is breaking in a known layer type, so it cannot be unsupported layers. In "/usr/local/bin/ncsdk/Controllers/" (where the code is breaking) there have been a few changes between sdk v1 and sdk v2. By comparing the runtime between the two files, I've managed to get it to compile :D but don't know if it actually works yet (I'll test soon - I first have to make the program use only one NCS). Before I forget, here are the changes I had to make:

    All changes are in "/usr/local/bin/ncsdk/Controllers/" (from sdk 2 install). Note: I have no clue what I'm doing and take no responsibility for screwing up your install.

    line ~1146:


    elif ((node.type == 'Add' or node.type == 'Mul' or node.type == 'Maximum') and
                        get_input(strip_tensor_id(node.inputs[0].name), False) != 0 and
                        get_input(strip_tensor_id(node.inputs[1].name), False) != 0 and

    should be:

     elif ((node.type == 'Add' or node.type == 'Mul' or node.type == 'Maximum') and
                        ("alpha" not in node.inputs[0].name and get_input(strip_tensor_id(node.inputs[0].name), False) != 0) and
                        ("alpha" not in node.inputs[1].name and get_input(strip_tensor_id(node.inputs[1].name), False) != 0) and

    line ~1126:


    elif (node.type == "Concat" or node.type == "ConcatV2") and not node.inputs[0].dtype.is_integer:
                    if debug:
                    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()
                        [a_input[0], a_input[1], a_input[2], concat_channel_size])

    should be:

     elif (node.type == "Concat" or node.type == "ConcatV2") and not node.inputs[0].dtype.is_integer:
                    if debug:
                    concat_channel_size = 0
                    inputs = node.inputs
                    for src in inputs:
                        dim = len(src.get_shape())-1
                        if dim > 0:
                            concat_channel_size += int(src.get_shape()[dim])
                    a_input = node.inputs[1].get_shape()
                    if len(a_input) == 2:
                        node.outputs[0].set_shape([a_input[0], concat_channel_size])
                            [a_input[0], a_input[1], a_input[2], concat_channel_size])
  • edited October 5 Vote Up0Vote Down

    Well, it didn't work. Trying to run the graph produces a mighty error when calling output_pgraph.read_elem(). I can make zero sense of what is wrong, so I don't know where to go from here.

    *** Error in `python3': malloc(): memory corruption: 0x0000000001dfd8a0 ***
    ======= Backtrace: =========
    ======= Memory map: ========
    00400000-007a9000 r-xp 00000000 08:01 11541642                           /usr/bin/python3.5
    009a9000-009ab000 r--p 003a9000 08:01 11541642                           /usr/bin/python3.5
    009ab000-00a42000 rw-p 003ab000 08:01 11541642                           /usr/bin/python3.5
    00a42000-00a73000 rw-p 00000000 00:00 0 
    015b7000-01e1a000 rw-p 00000000 00:00 0                                  [heap]
    7fd1f8000000-7fd1f8021000 rw-p 00000000 00:00 0 
    7fd224e88000-7fd224e8a000 rw-p 0017c000 08:01 11536513                   /usr/lib/x86_64-linux-gnu/
    7fd224e8a000-7fd224e8e000 rw-p 00000000 00:00 0 Aborted (core dumped)
  • So it seems OOM problem?Can you test it on two sticks?

Sign In or Register to comment.