Benchmark models¶
Larq Compute Engine provides prebuilt binaries to benchmark Larq converted models on Android phones or 64-bit ARM based systems like the Raspberry Pi.
-
Download the prebuilt benchmarking binary from the latest release:
wget https://github.com/larq/compute-engine/releases/download/v0.7.0/lce_benchmark_model_aarch64 -O lce_benchmark_model
-
Make the binary executable:
chmod +x lce_benchmark_model
-
Benchmark the converted
.tflite
model:Add./lce_benchmark_model --graph=quicknet.tflite --num_threads=4
--help
to the command for a detailed description of the available benchmarking options.
-
Install the Android Debug Bridge (adb) on your host machine. E.g. on macOS you can install it via
brew
:brew cask install android-platform-tools
-
Follow the instructions here to enable "USB debugging" on your Android phone.
-
Connect your phone and run the following command to confirm that your host computer recognises your phone:
adb devices
-
Download the prebuilt Android benchmarking binary from the latest release:
wget https://github.com/larq/compute-engine/releases/download/v0.7.0/lce_benchmark_model_android_arm64 -O lce_benchmark_model
-
Transfer the LCE inference binary to your phone:
adb push lce_benchmark_model /data/local/tmp
-
Transfer the converted
.tflite
model file to your phone:adb push quicknet.tflite /data/local/tmp
-
Make the binary executable:
adb shell chmod +x /data/local/tmp/lce_benchmark_model
-
Benchmark the model:
Addadb shell /data/local/tmp/lce_benchmark_model \ --graph=/data/local/tmp/quicknet.tflite \ --num_threads=4
--help
to the command for a detailed description of the available benchmarking options.