From: Efimov Alexander/AI Tools Lab/./Samsung Electronics Date: Mon, 16 Jul 2018 12:43:14 +0000 (+0300) Subject: add nnc section into readme (#607) X-Git-Tag: nncc_backup~2412 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e6fe2bea2e8fb87679985c73d202f98883b9bfc;p=platform%2Fcore%2Fml%2Fnnfw.git add nnc section into readme (#607) Add nnc readme Adds nnc README.md file to describe how it works Signed-off-by: Efimov Alexander --- diff --git a/contrib/nnc/README.md b/contrib/nnc/README.md new file mode 100644 index 0000000..e824c78 --- /dev/null +++ b/contrib/nnc/README.md @@ -0,0 +1,74 @@ +# nnc +Neural Network Compiler + +### DESCRIPTION + +nnc is a neural network compiler that transforms neural networks of various formats into source or machine code. +Most functionality of nnc is stored in dynamically linked plugins. +> At this moment only two NN are supported (MobileNet and InceptionV3) in Tensorflow Lite or Caffe format. + +### SYNOPSIS + +nnc [NNC OPTIONS] [PLUGIN OPTIONS] + +### OPTIONS + +``--plugins-path`` + +select directory where to search for plugins. +looks recursively into selected dir and finds all plugins it can load. + +``--plugins-verbose`` + +print info about found plugins + +``--plugins-help`` + +print help messages from plugins + +``--help`` + +print help message + +### USAGE + +Assuming that current directory is a build root and we have tflite model(for example inceptionv3.tflite) + +**1. Running nnc in interpreter mode:** +``` +./nnc --plugins-path . \ +--input-filename inceptionv3.tflite \ +--filename data.file \ +--input input --output output +``` + + +``--plugins-path .`` is a _general nnc_ option, it sets plugin search root to current directory. + +``--input-filename inceptionv3.tflite`` this is a _tflite importer_ option, it feeds importer with inception neural network. + +``--filename data.file`` is a _interpreter_ option, it points to file with neural network input data, this file contains array of floats in binary form. + +``--input`` is a _interpreter_ option, it sets input node in Computational Graph. + +``--output`` is a _interpreter_ option, it sets output node in Computational Graph. + +**2. Running to generate C/C++ source code:** + +``` +./nnc --plugins-path . \ +--input-filename inceptionv3.tflite \ +--emit-source c++ \ +--out-code nn.cpp \ +--out-header nn.h \ +--out-model param.file

+``` + +``--emit-source c++`` is a _soft backend_ option that selects target language to emit + +``--out-code nn.cpp`` is a _soft backend_ option, it sets path to source code file + +``--out-header nn.h`` is a _soft backend_ option, it sets path to header file + +``--out-model param.file`` is a _soft backend_ option, it sets path to file with model parameters +