【Linux】Ubuntu下安装paddlepaddle

  • Post author:
  • Post category:linux


**



install using pip

**

First, we use the following commands to check if the environment of this machine is suitable for installing PaddlePaddle:

uname -m && cat /etc/*release

The above command will display the operating system and processing bits of the machine. Please make sure your computer is consistent with the requirements of this tutorial.

Second, your computer needs to meet any of the following requirements:

Python2.7.x (dev), Pip >= 9.0.1

Python3.5+.x (dev), Pip3 >= 9.0.1

You may have installed pip on your Ubuntu. Please use pip -V or pip3 -V to confirm its version is the recommended pip 9.0.1 or higher.

Update apt source:

apt update


Use the following command to install or upgrade Python and pip to the required version: (pip and dev installation in python3.6, python3.7 differs greatly across different Ubuntu versions, thus the steps are omitted here)

  • For python2:

    sudo apt install python-dev python-pip

  • For python3.5:

    sudo apt install python3.5-dev and curl https://bootstrap.pypa.io/get-pip.py -o - | python3.5 && easy_install pip

    For python3.6, python3.7: We assumed that python3.6 (3.7) and the corresponding versions of dev and pip3 are properly installed by yourself.

    Even if you already have Python 2 or Python 3 in your environment, you need to install Python-dev or Python 3.5 (3.6, 3.7) -dev.

Now let’s install PaddlePaddle:

Use pip install to install PaddlePaddle

For users who need the CPU version PaddlePaddle:

pip install paddlepaddle

or

pip3 install paddlepaddle

For users who need the GPU version PaddlePaddle:

pip install paddlepaddle-gpu

or

pip3 install paddlepaddle-gpu

1.In order to prevent problem “nccl.h cannot be found”, please first install nccl2 according to the following command (here is ubuntu 16.04, CUDA9, ncDNN v7 nccl2 installation instructions), for more information about the installation information, please refer to the NVIDIA official website:

 i. `Wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/nvidia-machine-learning-repo-ubuntu1604_1.0.0-1_amd64.deb`
 ii. `dpkg -i nvidia-machine- Learning-repo-ubuntu1604_1.0.0-1_amd64.deb`
 iii. `sudo apt-get install -y libnccl2=2.2.13-1+cuda9.0 libnccl-dev=2.2.13-1+cuda9.0`

2.If you do not specify the pypi package version number, we will by default provide you with a version of PaddlePaddle that supports Cuda 9/cuDNN v7.

For users with Cannot uninstall ‘six’. problems, the probable reason is the existing Python installation issues in your system. In this case, use

pip install paddlepaddle --ignore-installed six

(CPU) or

pip install paddlepaddle-gpu -- Ignore-installed six

(GPU) to resolve.

For users with other requirements:

pip install paddlepaddle==[version number]

or

pip3 install paddlepaddle==[version number]

For the version number, please refer to the latest Release installation package list. If you need to obtain and install the latest PaddlePaddle development branch, you can download and install the latest whl installation package and c-api development package from the latest dev installation package list or our CI system. To log in, click on “Log in as guest”.

Now you have completed the process of installing PaddlePaddle using

pip install.

原文链接:https://www.paddlepaddle.org.cn/documentation/docs/en/1.5/beginners_guide/install/install_Ubuntu_en.html



版权声明:本文为heroybc原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。