3 `pb2nnpkgtc` is a tool to select a subgraph of pb model and convert to `nnpackage` with golden data and generated pb.
5 It takes `pb` as input and generates `nnpackage`.
9 Install tensorflow >= 1.12. It is tested with tensorflow 1.13, 1.14 and 2.0.
11 Install node. (Any version will do. I recommend you to use `nvm`.)
13 Set environmet variables from usage below.
19 Usage: pb2nnpkgtc.sh [options] pb inputs outputs
20 Convert pb to nnpkg-tc
28 -o set output directory (default=.)
30 Environment variables:
32 (default=./build/externals/FLATBUFFERS/build/flatc)
33 tflite_schema path to tflite schema (i.e. schema.fbs)
34 circle_schema path to tflite schema (i.e. schema.fbs)
40 $ tools/nnpackage_tool/sth2nnpkgtc/pb2nnpkgtc.sh test_model.pb img_placeholder conv2d_transpose
42 # then, nnpkg is generated in {basename}.{outputname}
43 # it contains all of pb, tflite, circle, and golden data.
45 $ tree test_model.conv2d_transpose
46 test_model.conv2d_transpose
47 ├── test_model.conv2d_transpose.circle
48 ├── test_model.conv2d_transpose.pb
49 ├── test_model.conv2d_transpose.tflite
57 $ OP_BACKEND_ALLOPS=cpu \
58 tests/scripts/nnpkg_test.sh test_model.conv2d_transpose
59 [ Run ] ./test_model.out Pass
60 [Compare] ./test_model.out Pass