Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6401 Discussions

Shape rank errors when converting Tensorflow model

idata
Employee
1,246 Views

I have a Tensorflow model I am trying to convert. The model is frozen from .ckpt files then prepared for inference.

 

I'm getting two exceptions that both relate to the same layer and a problem with rank.

 

mvNCCompile /tmp/mov.pb -in inputA -on a2b_generator/output_image /usr/local/bin/ncsdk/Controllers/Parsers/TensorFlowParser/Convolution.py:44: 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/tf_inspect.py:45: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/common_shapes.py", line 686, in _call_cpp_shape_fn_impl input_tensors_as_shapes, status) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py", line 516, in __exit__ c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.InvalidArgumentError: Shape must be rank 4 but is rank 0 for 'a2b_generator/Conv2d_transpose_1/conv2d_transpose' (op: 'Conv2DBackpropInput') with input shapes: ?, [3,3,64,128], [?,300,300,128] and with input tensors computed as partial shapes: input[0] = []. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/bin/mvNCCompile", line 169, in <module> create_graph(args.network, 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/Scheduler.py", line 100, in load_network parse_ret = parse_tensor(arguments, myriad_conf) File "/usr/local/bin/ncsdk/Controllers/TensorFlowParser.py", line 212, in parse_tensor tf.import_graph_def(graph_def, name="") File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/deprecation.py", line 432, in new_func return func(*args, **kwargs) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/importer.py", line 687, in import_graph_def ops.set_shapes_for_outputs(op) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 2496, in set_shapes_for_outputs return _set_shapes_for_outputs(op) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 2469, in _set_shapes_for_outputs shapes = shape_func(op) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 2399, in call_with_requiring return call_cpp_shape_fn(op, require_shape_fn=True) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/common_shapes.py", line 627, in call_cpp_shape_fn require_shape_fn) File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/common_shapes.py", line 691, in _call_cpp_shape_fn_impl raise ValueError(err.message) ValueError: Shape must be rank 4 but is rank 0 for 'a2b_generator/Conv2d_transpose_1/conv2d_transpose' (op: 'Conv2DBackpropInput') with input shapes: ?, [3,3,64,128], [?,300,300,128] and with input tensors computed as partial shapes: input[0] = [].

 

The file I am trying to convert is hosted here: https://github.com/andrewginns/CycleGAN-Tensorflow-PyTorch/releases/download/n2p/movidius-graph.pb

0 Kudos
0 Replies
Reply