Skip to content

Instantly share code, notes, and snippets.

@serihiro
Last active May 21, 2021 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save serihiro/6547f0435c0bf4999b19620ba75c05f4 to your computer and use it in GitHub Desktop.
Save serihiro/6547f0435c0bf4999b19620ba75c05f4 to your computer and use it in GitHub Desktop.
A note about "Running AlexNet on Raspberry Pi with Arm Compute Library" at arm Developer

About this note

The step that worked for me

Build ComputeLibrary

git clone https://github.com/Arm-software/ComputeLibrary.git
cd ComputeLibrary
# The description of the tutorial says `opencl=1` and SCons will build codes with OpenCL.
# But this will not work beacuse OpenCL is not supported for Raspberry Pi (cannot find `*.so` files for OpenCL)
scons --jobs 2 Werror=1 debug=0 asserts=0 neon=1 opencl=0 examples=1 build=native

Run AlexNet + ImageNet sample

cd ComputeLibrary
# Actual options are different from the description at all...
# Maybe the description is not following the updates of the examples.
LD_LIBRARY_PATH=./build ./build/examples/graph_alexnet \
--data=../assets_alexnet \
--target=NEON \
--threads=2 \
--image=../assets_alexnet/go_kart.ppm \
--labels=../assets_alexnet/labels.txt
  • The output
./build/examples/graph_alexnet

Threads : 2
Target : NEON
Data type : F32
Data layout : NHWC
Tuner enabled? : false
Tuner mode : Normal
Tuner file :
Fast math enabled? : true
Data path : ../assets_alexnet
Image file : ../assets_alexnet/go_kart.ppm
Labels file : ../assets_alexnet/labels.txt

---------- Top 5 predictions ----------

0.6988 - [id = 573], n03444034 go-kart
0.1242 - [id = 751], n04037443 racer, race car, racing car
0.0351 - [id = 518], n03127747 crash helmet
0.0290 - [id = 817], n04285008 sports car, sport car
0.0099 - [id = 981], n09835506 ballplayer, baseball player

Test passed
@meitiever
Copy link

I got this output:
./build/examples/graph_alexnet

Threads : 2
Target : NEON
Data type : F32
Data layout : NHWC
Tuner enabled? : false
Cache enabled? : false
Tuner mode : Normal
Tuner file :
Fast math enabled? : false
Data path : /home/pi/Documents/assets_alexnet
Image file : /home/pi/Documents/assets_alexnet/go_kart.ppm
Labels file : /home/pi/Documents/assets_alexnet/labels.txt

---------- Top 5 predictions ----------

1.0000 - [id = 672], n03792972 mountain tent
1.0000 - [id = 657], n03773504 missile
1.0000 - [id = 658], n03775071 mitten
1.0000 - [id = 659], n03775546 mixing bowl
1.0000 - [id = 660], n03776460 mobile home, manufactured home

Test passed

any idea? and i tested this example on two device and the output is the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment