From: 박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 Date: Mon, 10 Dec 2018 06:43:29 +0000 (+0900) Subject: [nnkit] Update README.md with nnkit-run (#2581) X-Git-Tag: nncc_backup~1140 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28ebf51bc5eb6beedfc9e4737445e3e3abafc517;p=platform%2Fcore%2Fml%2Fnnfw.git [nnkit] Update README.md with nnkit-run (#2581) This commit replaces all the reference of deprecated "nni" in README.md with "nnkit-run". Signed-off-by: Jonghyun Park --- diff --git a/contrib/nnkit/README.md b/contrib/nnkit/README.md index 4746cb2..d4d2fba 100644 --- a/contrib/nnkit/README.md +++ b/contrib/nnkit/README.md @@ -2,21 +2,21 @@ `nnkit` is collection of neural networks tools for our _nncc_ project. -## nni +## nnkit-run -`nni` is a command line interface to interact with existing inference engines +`nnkit-run` is a command line interface to interact with existing inference engines or compiled artifacts. -## How nni works +## How nnkit-run works -`nni` first dynamically loads `backend` and multiple pre/post `action` -specified by command-line. After loading backend and actions, `nni` requests +`nnkit-run` first dynamically loads `backend` and multiple pre/post `action` +specified by command-line. After loading backend and actions, `nnkit-run` requests `backend` to prepare itself. When backend is prepared, `backend` exposes its -internal state to `nni` (as `nnkit::TensorContext`). -`nni` takes this state, and passes it to registered pre `action`(s). +internal state to `nnkit-run` (as `nnkit::TensorContext`). +`nnkit-run` takes this state, and passes it to registered pre `action`(s). Each action may read tensor(s) (e.g. dump the content into a file), or manipuate their value (e.g. fill random values). -`nni` then invokes `backend` through `run()` method. +`nnkit-run` then invokes `backend` through `run()` method. After successful running the `backend`, post `action`(s) are called same like pre `action`(s) as a teardown step. @@ -27,9 +27,9 @@ Currently there are two backends as of writing this document - Caffe as `libnnkit_caffe_backend.so` - Tensorflow Lite as `libnnkit_tflite_backend.so` -# How to run inference with nni +# How to run inference with nnkit-run -To run `nni`, we need to provide a backend module and argument(s) if required +To run `nnkit-run`, we need to provide a backend module and argument(s) if required and optional `pre-` or `post-` action module(s) ## Building backends @@ -61,7 +61,7 @@ Syntax is `--argument` with `value` form. Existing arguments are as follows. For example, ``` -nni \ +nnkit-run \ --backend ./path/to/backend --backend-arg arg1 --backend-arg arg2 \ --pre ./path/to/preA --pre-arg arg1preA --pre-arg arg2preA \ --pre ./path/to/preB --pre-arg arg1preB --pre-arg arg2preB \ @@ -79,7 +79,7 @@ This will run ``` cd build -contrib/nnkit/tools/nni/nni \ +contrib/nnkit/tools/run/nnkit-run \ --backend ./contrib/nnkit/backends/tflite/libnnkit_tflite_backend.so \ --backend-arg inceptionv3_non_slim_2015.tflite ``` @@ -94,7 +94,7 @@ Running with caffe backend is similar to running with tflite, except that you ne ``` cd build -contrib/nnkit/tools/nni/nni \ +contrib/nnkit/tools/run/nnkit-run \ --backend ./contrib/nnkit/backends/caffe/libnnkit_caffe_backend.so --backend-arg inception_v3.prototxt ``` @@ -105,7 +105,7 @@ The above command shows nothing except `nnapi error: unable to open library libn ``` cd build -contrib/nnkit/tools/nni/nni \ +contrib/nnkit/tools/run/nnkit-run \ --backend ./contrib/nnkit/backends/tflite/libnnkit_tflite_backend.so \ --backend-arg inceptionv3_non_slim_2015.tflite \ --post ./contrib/nnkit/actions/builtin/libnnkit_show_action.so @@ -113,7 +113,7 @@ contrib/nnkit/tools/nni/nni \ The following command initializes input tensors with random values generated by `RandomizeAction` pre-action. ``` -contrib/nnkit/tools/nni/nni \ +contrib/nnkit/tools/run/nnkit-run \ --backend ./contrib/nnkit/backends/tflite/libnnkit_tflite_backend.so \ --backend-arg inceptionv3_non_slim_2015.tflite \ --pre ./contrib/nnkit/actions/builtin/libnnkit_randomize_action.so \ @@ -127,7 +127,7 @@ You can drop a HDF5 file of inputs and outputs with `HDF5_export_action` action ``` cd build -contrib/nnkit/tools/nni/nni \ +contrib/nnkit/tools/run/nnkit-run \ --backend ./contrib/nnkit/backends/tflite/libnnkit_tflite_backend.so \ --backend-arg inceptionv3_non_slim_2015.tflite \ --pre ./contrib/nnkit/actions/HDF5/libnnkit_HDF5_export_action.so \