tflite benchmark model测试

假设Android NDK与SDK都安装完毕了,所以接下来只需要这几步:

1,编译benchmark程序

bazel build -c opt \

  --config=android_arm \

  --cxxopt='--std=c++11' \

  --copt=-DTFLITE_PROFILING_ENABLED \

  tensorflow/lite/tools/benchmark:benchmark_model

2,将benchmark_model压入手机中

adb push bazel-bin/tensorflow/lite/tools/benchmark/benchmark_model /data/local/tmp

3,将模型压入手机中

adb push mobilenet_quant_v1_224.tflite /data/local/tmp

4,测试模型

adb shell /data/local/tmp/benchmark_model \
  --graph=/data/local/tmp/mobilenet_quant_v1_224.tflite \
  --num_threads=4

参考:https://my.oschina.net/u/4031275/blog/2960789

 

如果觉得这篇文档帮到你,可以打赏嘛

你可能感兴趣的:(机器学习机器学习实战)