Build an ML framework for Arm
The framework you choose may depend on the application you wish to run. This example uses Baidu's DeepSpeech 2, a state-of-the-art speech recognition system that provides very high-quality models for both English and Chinese.
DeepSpeech 2 is built on Baidu's PaddlePaddle framework. Although less well-known than TensorFlow, it is just as easy to build and configure on an Armv8 system.
The instructions provided here work on Ubuntu 16.04 LTS running on a packet.net type 2A server. For reference, the official guide for building PaddlePaddle from source is here: https://github.com/PaddlePaddle/DeepSpeech.
Install dependencies
Most dependencies are already pre-built for Armv8. Logged in to the server, enter the following to a command line to obtain and install the dependencies from standard repositories:
apt-get update
apt-get -y install python-dev python-pip python-numpy python-scipy python-wheel git cmake swig golang libfreetype6-dev libpng12-dev libopenblas-dev
pip install protobuf
git clone https://github.com/PaddlePaddle/recordio.git
cd recordio/python
./build.sh
pip install -e .
cd ../..
Build PaddlePaddle
Building from source can take several hours. Once complete, you can copy the *.whl file and deploy it directly onto subsequent servers. To build from source:
git clone https://github.com/PaddlePaddle/Paddle.git
cd Paddle
mkdir build
cd build
cmake -DWITH_GPU=OFF -DWITH_TESTING=OFF ..
make -j96
cd ../..
Install PaddlePaddle
Installing the built package is straightforward.
- Display the contents of the python/dist directory by entering the ls command. Note the version number in the name of the .whl file.
- Enter this command and add the version number that you noted in step 1:
pip install Paddle/build/python/dist/paddlepaddle*.whl