The steps to install paddle on centos 7

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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值