Requirements
create user and directories
useradd hadoop
cd /home/hadoop
centos version:
# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
install dependencies
Python Dependencies(optional)
To compile PaddlePaddle with python predict API,make sure swig installed and set -DWITH_SWIG_PY=ON as follows:
install swig on centos
yum -y install swig
yum update
yum install -y g++ make cmake build-essential libatlas-base-dev python python-pip libpython-dev m4 libprotobuf-dev protobuf-compiler python-protobuf python-numpy git
yum install libgoogle-glog-dev
yum install libgflags-dev
yum install libgtest-dev
yum install blas
check python version
# python --version
Python 2.7.5
install protobuf
wget https://github.com/google/protobuf/archive/v3.1.0.tar.gz
tar zxvf v3.1.0.tar.gz
cd protobuf-3.1.0
yum -y install autoconf automake libtool
./autogen.sh
./configure
make && make install
protoc --version
reinstall cmake
Note,paddle write hard the location of cmake as ‘/usr/bin/cmake’
yum -y remove cmake
wget https://cmake.org/files/v3.8/cmake-3.8.1.tar.gz
tar -xzf cmake-3.8.1.tar.gz
cd cmake-3.8.1
./bootstrap
make
make install
cd ..
ln -s /usr/local/bin/cmake /usr/bin/cmake
ln -s /usr/local/bin/ctest /usr/bin/ctest
ln -s /usr/local/bin/cpack /usr/bin/cpack
install python
yum install python-devel
easy_install-2.7 pip
pip install wheel
#pip install protobuf
easy_install protobuf
pip2.7 install --upgrade pip
install numpy
wget http://jaist.dl.sourceforge.net/project/numpy/NumPy/1.9.0/numpy-1.9.0.zip
unzip numpy-1.9.0.zip
cd numpy-1.9.0/
./setup.py install
install paddle
git the source code,
git clone https://github.com/baidu/Paddle paddle
cd paddle
Only cpu
mkdir build && cd build
cmake .. -DWITH_GPU=OFF -DWITH_SWIG_PY=ON
make -j `nproc` && make install
output the following contents.
CMake Error at CMakeLists.txt:23 (cmake_minimum_required):
CMake 3.0 or higher is required. You are running version 2.8.12.2
Note:
If you set WITH_SWIG_PY=ON,related python dependencies also need to be installed. Otherwise,PaddlePaddle will automatically install python dependencies at first time when user run paddle commands,such as paddle version,paddle train. It may require sudo privileges:
sudo pip install <path to install>/opt/paddle/share/wheels/*.whl
If display the following errors when training the data,please reinstall protobuf-python
Python Error: <type 'exceptions.ImportError'> : cannot import name symbol_database
Python Callstack:
/usr/lib/python2.7/site-packages/paddle/trainer/config_parser.py : 86
/usr/lib/python2.7/site-packages/paddle/proto/__init__.py : 15
/usr/lib/python2.7/site-packages/paddle/proto/TrainerConfig_pb2.py : 9
pip uninstall protobuf easy_install protobuf