The steps to install paddle on centos 7

来源:互联网 发布:武汉理工学网络教育 编辑:程序博客网 时间:2024/06/05 17:14

Requirements

create user and directories

useradd hadoopcd /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 updateyum install -y g++ make cmake build-essential libatlas-base-dev python python-pip libpython-dev m4 libprotobuf-dev protobuf-compiler python-protobuf python-numpy gityum install libgoogle-glog-devyum install libgflags-devyum install libgtest-dev
yum install blas

check python version

# python --versionPython 2.7.5

install protobuf

wget https://github.com/google/protobuf/archive/v3.1.0.tar.gztar zxvf v3.1.0.tar.gz cd protobuf-3.1.0yum -y  install autoconf automake libtool./autogen.sh./configuremake && make installprotoc --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.gztar -xzf cmake-3.8.1.tar.gzcd cmake-3.8.1./bootstrapmakemake installcd ..ln -s /usr/local/bin/cmake /usr/bin/cmakeln -s /usr/local/bin/ctest /usr/bin/ctestln -s /usr/local/bin/cpack /usr/bin/cpack

install python

yum install python-develeasy_install-2.7 pippip install wheel#pip install protobufeasy_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.zipunzip 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 paddlecd paddle

Only CPU

mkdir build && cd build cmake  .. -DWITH_GPU=OFF  -DWITH_SWIG_PY=ONmake -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_databasePython 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 protobufeasy_install protobuf
0 0
原创粉丝点击