I'm trying to load a quantized graph into an Android app. My BUILD file contains
deps = ["//tensorflow/core:android_tensorflow_lib",
"//tensorflow/contrib/quantization:cc_array_ops",
"//tensorflow/contrib/quantization:cc_math_ops",
"//tensorflow/contrib/quantization:cc_nn_ops",
"//tensorflow/contrib/quantization/kernels:quantized_ops"]
The additional quantization deps work for standalone C++ builds.
I can't compile with Bazel, due to a large number of errors in GEMMLOWP. What's the proper way to include gemmlowp and the quantization ops in Android?
Here is an example error:
external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.cc:125:13: error: 'int32_t' is not a member of 'std'
MatrixMap<std::int32_t, ResultOrder> result(c, m, n, ldc);
This is on Ubuntu 16.04 with Bazel 0.3.0.
Here's a gist that has the output of two sequential attempts to build the package - it fails on highwayhash the first time and gemmlowp the second. https://gist.github.com/ericdanz/81b799f2e0bbb3cc462aa3c90468c71b
Ultimately got it to compile and run with liberal addition of "-std=c++11" in BUILD files for gemmlowp and highwayhash, and substitution of the android framework for the framework dependencies in the quantized ops. It produces fairly different results though, and runs about 4x slower (26-3200ms vs 6-800 ms). I'll try to do a little deeper investigation.
external/gemmlowp/eight_bit_int_gemm/../public/../internal/../public/bit_depth.h:39:1: warning: scoped enums only available with -std=c++11 or -std=gnu++11 enum class RoundingMode { ^ external/gemmlowp/eight_bit_int_gemm/../public/../internal/../public/bit_depth.h:51:58: error: 'RoundingMode' is not a class or namespace static const RoundingMode kRoundingModeForSmallSizes = RoundingMode::Exact;I am using these values in the cc_binary part of my build file:copts = tf_copts() + ["-std=c++11","-O3"]- Eric D