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 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/tf_inspect.py:45: 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.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 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/saver.py", line 1927, in import_meta_graph
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/meta_graph.py", line 741, in import_scoped_meta_graph
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 457, in import_graph_def
_RemoveDefaultAttrs(op_dict, producer_op_list, graph_def)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/importer.py", line 227, in _RemoveDefaultAttrs
op_def = op_dict[node.op]
Could you please help on this?
@johnson Please view https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/tools/optimize_for_inference.... 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 https://movidius.github.io/ncsdk/tf_compile_guidance.html. Hope this helps.
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:
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)_
@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.