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!

Not able to convert my TensorFlow model to Movidius graph file

Hi,

I am working on a CNN implementation for speech enhancement. I have a TensorFlow checkpoint model (*.meta) file and am trying to compile it into a Movidius graph file so I can load it onto the NCS for inference. I followed the instructions in https://movidius.github.io/ncsdk/tf_compile_guidance.html, but I am still seeing problems compiling.

The main problem is that I am not able to figure out what names to give the compiler for input node and output node, since I did not add named nodes to my model during training. I tried looking at the model in Tensorboard and dumping the graph into a text file after loading it with tf.get_default_graph() to find those names. But, since the model is pretty complex, it is hard to match up the names with the nodes in the model.

Is there a way to detect the input and output nodes given a TensorFlow model? I can provide my model if needed.

When I use what I believe are the correct input/output nodes, this is what I see:

$ mvNCCompile model.ckpt-49999-inf.meta -in con1/Conv2D -on con10/add -o model.graph
mvNCCompile v02.00, Copyright @ Movidius Ltd 2016

/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py:766: DeprecationWarning: builtin type EagerTensor has no module attribute
EagerTensor = c_api.TFE_Py_InitEagerTensor(_EagerTensorBase)
/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/tf_inspect.py:45: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
if d.decorator_argspec is not None), _inspect.getargspec(target))
/usr/local/lib/python3.5/dist-packages/h5py/init.py:34: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/tensor_util.py:509: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
return np.fromstring(tensor.tensor_content, dtype=dtype).reshape(shape)
Traceback (most recent call last):
File "/usr/local/bin/mvNCCompile", line 118, in
create_graph(args.network, args.inputnode, args.outputnode, args.outfile, args.nshaves, args.inputsize, args.weights)
File "/usr/local/bin/mvNCCompile", line 104, in create_graph
net = parse_tensor(args, myriad_config)
File "/usr/local/bin/ncsdk/Controllers/TensorFlowParser.py", line 290, in parse_tensor
if have_first_input(strip_tensor_id(node.outputs[0].name)):
IndexError: list index out of range

System details:
I'm using Ubuntu 16.04 on an Intel® Core™ i3-5010U CPU and Intel® HD Graphics 5500 (Broadwell GT2) GPU.
tensorflow version is 1.8.0
NCSDK version is 1.12.00.01

Thanks,
Lalitha

Sign In or Register to comment.