-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun-tflite.sh
More file actions
executable file
·47 lines (37 loc) · 1.83 KB
/
run-tflite.sh
File metadata and controls
executable file
·47 lines (37 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# Copyright (c) 2026 Qualcomm Technologies, Inc. All rights reserved.
# Workaround binaries expecting .so instead of proper SOVERSIONed name
ln -sf /usr/lib/aarch64-linux-gnu/libOpenCL.so.1 /usr/lib/aarch64-linux-gnu/libOpenCL.so
ln -sf /usr/lib/aarch64-linux-gnu/libcdsprpc.so.1.0.0 /usr/lib/aarch64-linux-gnu/libcdsprpc.so
cd ~/tensorflow/lite/examples/label_image
set -x
echo "Running label_image using CPU"
./label_image --image=grace_hopper.bmp --use_gpu=false
# Only run when there's at least one device node present
rendernode="$(ls -1 /dev/card/renderD* | head -n1)"
if [ -e "${rendernode}" ] ; then
echo "Running label_image using GPU"
./label_image --image=grace_hopper.bmp --use_gpu=true
fi
# Only run when there's at least one device node present
fastrpcnode="$(ls -1 /dev/fastrpc-cdsp* | head -n1)"
if [ -e "${fastrpcnode}" ] ; then
echo "Running label_image using CDSP"
./label_image --image=grace_hopper.bmp --external_delegate_path=/usr/local/lib/libQnnTFLiteDelegate.so --external_delegate_options='backend_type:htp'
fi
cd ~/tensorflow/lite/tools/benchmark
cp ../../examples/label_image/*mobile* .
echo "running benchmark_model using CPU"
./benchmark_model --graph=mobilenet_quant_v1_224.tflite --use_gpu=false
# Only run when there's at least one device node present
rendernode="$(ls -1 /dev/card/renderD* | head -n1)"
if [ -e "${rendernode}" ] ; then
echo "running benchmark_model using GPU"
./benchmark_model --graph=mobilenet_quant_v1_224.tflite --use_gpu=true
fi
# Only run when there's at least one device node present
fastrpcnode="$(ls -1 /dev/fastrpc-cdsp* | head -n1)"
if [ -e "${fastrpcnode}" ] ; then
echo "running benchmark_model using CDSP"
./benchmark_model --graph=mobilenet_quant_v1_224.tflite --external_delegate_path=/usr/local/lib/libQnnTFLiteDelegate.so --external_delegate_options='backend_type:htp'
fi