1 # tf2circle-value-pbtxt-remote-test
3 `tf2circle-value-pbtxt-remote-test` does random value test for `.circle` file using remote machine, normally Odroid, which `nnfw` runs on.
8 - Make sure that Tensorflow library could be found at `nncc configure` step. If there is no Tensorflow library, this test will not be created.
9 - If CMake reports TensorFlow library is not found in configure step, even when the library exists, set [`TENSORFLOW_PREFIX`](../../infra/cmake/packages/TensorFlowConfig.cmake#1) to include Tensorflow library like below.
11 $ ./nncc configure -DTENSORFLOW_PREFIX=/path/to/Tensorflow/library
13 - `TENSORFLOW_PREFIX` should contain Tensorflow library as shown below.
27 1. Runtime Library and Binary files
28 - Detailed information is located in [here](../../docs/nnfw/howto/CrossBuildForArm.md)
29 - If you build runtime, related files will be produced in `Product/out`. Do not rename or move it.
30 - (TBD) Support native build option
31 1. Remote machine information and test list
32 - You should create `test.lst` file first as shown below.
33 - Set IP address and username of remote machine using `set` command.
34 - Add Tensorflow models which you want to verify, which are in `/res/TensorflowTests/`
36 #--------------- Remote Machine Setting ---------------#
37 set(REMOTE_IP "xxx.xxx.xxx.xxx")
38 set(REMOTE_USER "remote_username")
40 #--------------------- Tests list ---------------------#
45 - If any Tensorflow model is added, or if `REMOTE_IP` and `REMOTE_USER` is not given, `tf2circle-value-pbtxt-remote-test` will not be created.
46 1. (Optional) ssh authentication
47 - This test uses `ssh` and `scp` commands, and those commands require a password of remote machine whenever they are called. This means that you should enter the password everytime when `ssh` and `scp` require.
48 - This test resolves the problem by using `ssh-copy-id`, which copies the public key of host machine to `authorized_keys` of remote machine. Because of that, this test will ask the password of remote machine only once, at the first time. This is the only user interaction while running this test.
49 - If you do not want to interact with system, just do `ssh-copy-id ${REMOTE_USER}@${REMOTE_IP}` in advance, before running this test. Once `ssh-copy-id` is done, there will be no user-interaction action while running the test.
53 - If you finished prerequisites properly, configuring -> building -> testing steps create cmake test automatically.
54 - All the related materials will be sent to `REMOTE_WORKDIR` in remote machine. Default value of `REMOTE_WORKDIR` is `CVT_YYMMDD_hhmmss`, which means Circle Value Test done on YY/MM/DD at hh:mm:ss.
55 - `REMOTE_WORKDIR` will not be removed automatically after this test finish.
57 $ ./nncc configure && ./nncc build
59 # Default REMOTE_WORKDIR is CVT_YYMMDD_hhmmss folder
60 $ ./nncc test -R tf2circle_value_pbtxt_remote_test
62 # You can set REMOTE_WORKDIR where you have write privilege
63 $ REMOTE_WORKDIR=/path/you/want/ ./nncc test -R tf2circle_value_pbtxt_remote_test
66 ### Generated Files While Running
68 - All related files(`pb`, `circle`, `h5` ... etc.) are created in `build/compiler/tf2circle-value-pbtxt-remote-test` folder.
70 build/compiler/tf2circle-value-pbtxt-remote-test
71 ├ Result_latest -> Result_YYMMDD_hhmmss.csv
72 ├ Result_YYMMDD_hhmmss.csv
81 | └ UNIT_Add_000.circle
84 ├ UNIT_Add_000.expected.h5
86 ├ UNIT_Add_000.input.h5
94 - Runtime products and each nnpackage are sent to `REMOTE_WORKDIR` in remote machine.
95 - (TBD) Modify script not to remove obtained h5 file.
112 | | └ UNIT_Add_000.out.h5
113 | | (Only when comparing with expected.h5 fails)
115 | └ UNIT_Add_000.circle
119 ### Check Test Result
121 - Summary of test result will be created as csv file in host.
123 # Result_latest is symbolic link to the latest csv result file
124 # Print the latest test result
125 $ cat build/compiler/tf2circle-value-pbtxt-remote-test/Result_latest
126 TEST_NAME, TF2CIRCLE, CIRCLE_VALUE_TEST
127 UNIT_Add_000, TRUE, TRUE
130 # List all result csv files
131 $ ls build/compiler/tf2circle-value-pbtxt-remote-test/Result_*.csv
132 Result_20191119_212521.csv
135 - Detailed log file for each test cases is also created.
137 $ cat build/compiler/tf2circle-value-pbtxt-remote-test/*.log