How to test TFMnist example on Android device
Hello,
I tried to test armnn-devenv/armnn/tests/TfMnist-Armnn example. However, it is not compiled even within UnitTests binaries. Could any one provide a way to compile and test it on android device?
Best,
Fangming
Hi @phamyphen, those tests depend on some third-party IP(stb, which you can get from https://github.com/nothings/stb) that we can't distribute, and they aren't yet part of our supported product (hence no documentation for them...) but they do contain some interesting and useful example code.
After you've got the tests to compile, most of them will require hard-coded model protobufs and image files that we can't distribute. Probably the best thing for you to do would be to treat them as a starting point for your own testing.
The most useful program in that folder is 'ExecuteNetwork', which can take any model, and any input tensor, and simply prints out the output tensor. Hopefully, its internal command-line documentation will provide enough information for you to make use of it.
Anyways, to build the tests, update cmake/GlobalConfig.cmake - option(BUILD_TESTS "Build test applications" OFF) to ON and then run cmake with -DTHIRD_PARTY_INCLUDE_DIRS.
e.g:
CXX=aarch64-linux-android-clang++ CC=aarch64-linux-android-clang CXX_FLAGS="-fPIE -fPIC" cmake .. -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXE_LINKER_FLAGS=-pie -DARMCOMPUTE_ROOT=$HOME/armnn-devenv/ComputeLibrary/ -DARMCOMPUTE_BUILD_DIR=$HOME/armnn-devenv/ComputeLibrary/build -DBOOST_ROOT=$HOME/armnn-devenv/boost/install/ -DARMCOMPUTENEON=1 -DARMCOMPUTECL=1 -DTHIRD_PARTY_INCLUDE_DIRS=/home/surmeh01/armnn-devenv/armnn/third-party/stb -DTF_GENERATED_SOURCES=$HOME/armnn-devenv/google/tf_pb/ -DBUILD_TF_PARSER=1 -DPROTOBUF_ROOT=$HOME/armnn-devenv/google/arm64_pb_install/
Good luck, Surabhi
Is it possible to measure elapsed time on certain network ?
Hi @pcub,
You can have a look at armnn/tests/ExecuteNetwork/ExecuteNetwork.cpp and armnn/tests/InferenceTest.cpp.
They are tools that print out the inference timings of a given model. For more details you can for example run ExecuteNetwork -h to get the list of usage options.
Regards, Matteo
Hi @pcub,
I hope your question has been answered. Please open a new one if you need any further information.