Fix openailab logo link
[platform/upstream/caffeonacl.git] / acl_openailab / README.md
1 ![OPEN AI LAB](https://oaid.github.io/pics/openailab.png)
2
3 # 1. Release Notes
4 [![License](https://img.shields.io/badge/license-BSD-blue.svg)](LICENSE)
5
6 Please refer to [CaffeOnACL Release NOTE](https://github.com/OAID/caffeOnACL/blob/master/acl_openailab/Reversion.md) for details
7
8 # 2. Preparation
9 ## 2.1 General dependencies installation
10         sudo apt-get -y update
11         sodo apt-get -y upgrade
12         sudo apt-get install -y build-essential pkg-config automake autoconf protobuf-compiler cmake cmake-gui
13         sudo apt-get install -y libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev
14         sudo apt-get install -y libatlas-base-dev libgflags-dev libgoogle-glog-dev liblmdb-dev libopenblas-dev
15         sudo apt-get install -y libopencv-dev python-dev
16         sudo apt-get install -y python-numpy python-scipy python-yaml python-six python-pip
17         sudo apt-get install -y scons git
18         sudo apt-get install -y --no-install-recommends libboost-all-dev
19         pip install --upgrade pip
20
21 ## 2.2 Download source code
22 Recommend creating a new directory in your work directory to execute the following steps. For example, you can create a direcotry named "oaid" in your home directory by the following commands.<br>
23
24         cd ~
25         mkdir oaid
26         cd oaid
27
28 #### Download "ACL" (arm_compute : v17.05):
29         git clone https://github.com/ARM-software/ComputeLibrary.git
30 #### Download "CaffeOnACL" :
31         git clone https://github.com/OAID/caffeOnACL.git
32 #### Download "Googletest" :
33         git clone https://github.com/google/googletest.git
34
35 # 3. Build CaffeOnACL
36 ## 3.1 Build ACL :
37         cd ~/oaid/ComputeLibrary
38         scons Werror=1 -j8 debug=0 asserts=1 neon=1 opencl=1 embed_kernels=1 os=linux arch=arm64-v8a
39
40 ## 3.2 Build Caffe :
41         export ACL_ROOT=~/oaid/ComputeLibrary
42         cd ~/oaid/caffeOnACL
43         cp acl_openailab/Makefile.config.acl Makefile.config
44         make all distribute
45
46 ## 3.3 Build Unit tests
47 ##### Build the gtest libraries
48         cd ~/oaid/googletest
49         cmake CMakeLists.txt
50         make
51         sudo make install
52
53 ##### Build Caffe Unit tests
54         export CAFFE_ROOT=~/oaid/caffeOnACL
55         cd ~/oaid/caffeOnACL/unit_tests
56         make clean
57         make
58
59 ## 3.3 Run tests
60 If the output message of the following two tests is same as the examples, it means the porting is success.
61
62         export LD_LIBRARY_PATH=~/oaid/caffeOnACL/distribute/lib:~/oaid/ComputeLibrary/build
63
64 #### Reference Caffenet
65         cd  ~/oaid/caffeOnACL/data/ilsvrc12
66         sudo chmod +x get_ilsvrc_aux.sh
67         ./get_ilsvrc_aux.sh
68         cd ../..
69         ./scripts/download_model_binary.py ./models/bvlc_reference_caffenet
70         ./distribute/bin/classification.bin models/bvlc_reference_caffenet/deploy.prototxt models/bvlc_reference_caffenet/bvlc_reference_caffenet.caffemodel data/ilsvrc12/imagenet_mean.binaryproto data/ilsvrc12/synset_words.txt examples/images/cat.jpg
71         output message --
72           ---------- Prediction for examples/images/cat.jpg ----------
73           0.3094 - "n02124075 Egyptian cat"
74           0.1761 - "n02123159 tiger cat"
75           0.1221 - "n02123045 tabby, tabby cat"
76           0.1132 - "n02119022 red fox, Vulpes vulpes"
77           0.0421 - "n02085620 Chihuahua"
78
79 #### Unit test
80           cd ~/oaid/caffeOnACL/unit_tests
81           ./test_caffe_main
82           output message:
83             [==========] 29 tests from 6 test cases ran. (1236 ms total) [ PASSED ] 29 tests.