Showing results for 
Search instead for 
Did you mean: 
Community Manager

Can't compile tensorflow model to NCS

Hi @Tome_at_Intel


I'm using TensorFlow Speech Commands Example:


I trained the model and made predictions successfully in both CPU and GPU hardware.


And I want to make this example work with NCS + VM. And I already run NCS examples successfully in VM.




OS: Ubuntu 16.04 (Installed on VirtualBox 5.2.12 on Windows 7)




-Including TensorFlow 1.7





  • This example use "_speech_commands/train.py_" to train model.

  • And use "_speech_commands/label_wav.py_" to do prediction. (I get input node name '_wav_data:0_' and output node name '_labels_softmax:0_' at _label_wav.py_)


This example use a simple CNN structure (2 convolutional layers, 1 maxpooling layer). I knew some difficult model not supported by NCS yet. But this model is really simple.




I used the command to compile my ckpt file:


mvNCCompile conv.ckpt-4000.meta -s 12 -in wav_data:0 -on labels_softmax: -o conv.ckpt-4000.graph


And I got the following error message as below.




user@ncs-vm:~/Documents/tf$ mvNCCompile conv.ckpt-4000.meta -s 12 -in wav_data:0 -on labels_softmax:0 -o conv.ckpt-4000.graph


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


Traceback (most recent call last):


File "/usr/local/bin/mvNCCompile", line 169, in


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 214, in parse_tensor


saver = tf.train.import_meta_graph(path, clear_devices=True)


File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/training/", line 1927, in import_meta_graph




File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/", line 741, in import_scoped_meta_graph




File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/", line 432, in new_func


return func(_args, **kwargs)


File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/", line 457, in import_graph_def


_RemoveDefaultAttrs(op_dict, producer_op_list, graph_def)


File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/", line 227, in _RemoveDefaultAttrs


op_def = op_dict[node.op]


KeyError: 'DecodeWav'




Could you please help on this?


Thank you



Tags (1)
0 Kudos
3 Replies
Community Manager

@johnson Please view to remove training layers. Additionally, please remove dropout layers from the model (this could help). Information on making changes to your model to be NCS compliant can be found at Hope this helps.

Community Manager



Thank you for your reply. I read the links you provided.


I realized I need to remove training layers and dropout layers to make a inference only version model. And then compile the model to NCS model.


One thing I need to make clear first, according to the last line of Error Message I got:


_KeyError: 'DecodeWav'_


This example uses contrib_audio.decode_wav to decode a wav file then transfer to image, and then do Training/Inference things.


contrib_audio.decode_wav function is from tensorflow class:


_from tensorflow.contrib.framework.python.ops import audio_ops as contrib_audio_ (This class supports some audio processing)


_wav_decoder = contrib_audio.decode_wav(


wav_loader, desired_channels=1, desired_samples=desired_samples)_



  • If NCS supports class tensorflow.contrib.framework.python.ops?

  • If not, what should I do? (Maybe combine using TensorFlow-CPU version and TensorFlow-NCS supoort?)

  • If the the input data for NCS stick has to be image type data?


Thank you.




Community Manager

@johnson Currently, the NCSDK doesn't have the TensorFlow audio processing capabilities implemented and so far I haven't seen a NCS compatible model that doesn't use an image input. Doing a combination of TensorFlow CPU and TensorFlow NCS could work, but I imagine that isn't the solution that you have in mind. Models that use audio could work if converted to a spectrogram form.