ubuntu16.04下搭建百度飛漿環境CPU和GPU

 

一:安裝python

0:更新阿里的源(可選)

panchan@itvm21:~/Install$ cat /etc/apt/sources.list


deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
sudo apt-get update

1:完整安裝python3依賴

sudo apt-get update
sudo apt-get install build-essential python-dev python-setuptools python3-pip python-smbus
sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev
sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev
sudo apt-get install libssl-dev openssl
sudo apt-get install libffi-dev
sudo apt-get install libxpm-dev libxext-dev 
sudo apt-get install zlib1g-dev libbz2-dev libssl-dev libncurses5-dev libsqlite3-dev libreadline-dev tk-dev libgdbm-dev libdb-dev libpcap-dev xz-utils libexpat1-dev 
liblzma-dev libffi-dev libc6-dev


2:安裝python3.7

官網地址:https://www.python.org/downloads/release/python-377/

tar -xvf Python-3.7.7.tar.xz
cd Python-3.7.7
./configure --with-ssl
make
sudo make install

二:百度飛漿的安裝

 

確認 Python 和 pip 是 64 bit,並且處理器架構是x86_64架構,目前PaddlePaddle不支持arm64架構
下面的兩個命令分別輸出的是 "64bit" 和 "x86_64" 即可:

python3 -c "import platform;print(platform.architecture()[0]);print(platform.machine())"

1:百度飛漿的CPU版本的安裝

python3 -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple

 

安裝中若有報錯,如版本過低

WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

升級pip即可

sudo pip3 install --upgrade pip

驗證安裝是否成功

使用 python3 進入python解釋器,輸入import paddle.fluid ,再輸入 paddle.fluid.install_check.run_check()。
如果出現 Your Paddle Fluid is installed successfully!,說明您已成功安裝。
Python 3.7.7 (default, Mar 30 2020, 13:50:15) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paddle.fluid
pad>>> paddle.fluid.install_check.run_check()
Running Verify Paddle Program ... 
Your Paddle works well on SINGLE GPU or CPU.
I0330 14:55:49.900933 16450 parallel_executor.cc:440] The Program will be executed on CPU using ParallelExecutor, 2 cards are used, so 2 programs are executed in parallel.
W0330 14:55:49.902719 16450 fuse_all_reduce_op_pass.cc:74] Find all_reduce operators: 2. To make the speed faster, some all_reduce ops are fused during training, after fusion, the number of all_reduce ops is 1.
I0330 14:55:49.902873 16450 build_strategy.cc:365] SeqOnlyAllReduceOps:0, num_trainers:1
I0330 14:55:49.903852 16450 parallel_executor.cc:307] Inplace strategy is enabled, when build_strategy.enable_inplace = True
I0330 14:55:49.904664 16450 parallel_executor.cc:375] Garbage collection strategy is enabled, when FLAGS_eager_delete_tensor_gb = 0
Your Paddle works well on MUTIPLE GPU or CPU.
Your Paddle is installed successfully! Let's start deep Learning with Paddle now

 

2:GPU的環境安裝

步驟繁瑣且易錯...

另起一篇

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章