Intel® Movidius™ Neural Compute SDK

View the Project on GitHub

mvNCCompile

Type Function
Library Command Line Tools
Output Compiled graph file
See also mvNCProfile, mvNCCheck

Overview

mvNCCompile is a command line tool that compiles network and weights files for Caffe or TensorFlow™ models into an Intel® Movidius™ graph file format that is compatible with the Intel® Movidius™ Neural Compute SDK (Intel® Movidius™ NCSDK) and Neural Compute API (NCAPI).

Syntax

Caffe

mvNCCompile network.prototxt [-w network.caffemodel] [-s max_number_of_shaves] [-in input_node_name] [-on output_node_name] [-is input_width input_height] [-o output_graph_filename] [-ec]

TensorFlow™

mvNCCompile network.meta [-s max_number_of_shaves] [-in input_node_name] [-on output_node_name] [-is input_width input_height] [-o output_graph_filename] [-ec]
Argument Description
Caffe:
network.prototxt

TensorFlow™:
network.meta
network.pb
Name of the network file (required).
[-h, –help] Display help for the command.
[-w weights_file] Specify the weights filename from training. For Caffe this is the .caffemodel file. If omitted, zero weights will be used.

This option is not to be used for TensorFlow™ networks.
[-s max_number_of_shaves] Specify the maximum number of SHAVEs to use for network layers (default: 1).

The number of available SHAVEs depends on your neural compute device. The device runtime code may use fewer SHAVEs for some layers where measurements have typically shown no inference performance degradation (and consequently show a power benefit) from using fewer SHAVEs.
[-in input_node_name] Specify an alternative start point for the network. By default the network’s start point is the input layer. This option enables partial network processing. When used together with the -on option, the user can isolate one or more layers in a network for analysis.

This option is required for TensorFlow™ networks. You can use the name parameter (available for most layers) when creating your network and pass that name into this option.
To add a named node that doesn’t change the network you can use the following:
x = tensorflow.identity(prev_tensor, name='new_node')
[-on output_node_name] Specify an alternative end point for the network. By default the network’s end point is the output layer. This option enables partial network processing. When used together with the -in option, the user can isolate one or more layers in a network for analysis.

Be aware that the parser will stop at the first instance of this node name (e.g., a Relu following a Conv will not be processed if it shares the same name).

This option is required for TensorFlow™ networks. You can use the name parameter (available for most layers) when creating your network and pass that name into this option.
To add a named node that doesn’t change the network you can use the following:
x = tensorflow.identity(prev_tensor, name='new_node')
[-is input_width input_height] Specify input dimensions for networks that do not have dimension constraints on the input layer.

This option assumes that the batch size is 1 and the number of channels is 3.
[-o output_graph_filename] Specify an output graph filename. If this is not provided, “graph” will be used for the filename.
[-ec] Skip certain compiler optimizations for concatenation; this may correct some issues with invalid results from concat layers or compile failures.

Example

Caffe

mvNCCompile deploy.prototxt -w bvlc_googlenet.caffemodel -s 12 -in input -on prob -is 224 224 -o GoogLeNet.graph

TensorFlow™

mvNCCompile inception-v1.meta -s 12 -in=input -on=InceptionV1/Logits/Predictions/Reshape_1 -is 224 224 -o InceptionV1.graph

Notes