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, a_input, a_input, 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
Scale the output by this amount
--ma2480 Dev flag
--new-parser Dev flag
Thank you for advice.
@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?
@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.).
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
elif (node.type == "Concat" or node.type == "ConcatV2") and not node.inputs.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()) a_input = node.inputs.get_shape() if(concat_channel_size != 0):# added condition node.outputs.set_shape( [a_input, a_input, a_input, 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.