This instruction will show you how to compile PaddlePaddle on a *64-bit desktop or laptop* and Windows 10. The Windows systems we support must meet the following requirements:
## Environment preparation
* Windows 10 Professional Edition / Enterprise Edition
* Visual Studio 2015 Update3
***Windows 7/8/10 Pro/Enterprise(64bit)**
***GPU Version support CUDA 9.0/9.1/9.2/10.0/10.1, and only support single GPU**
***Python version 2.7.15+/3.5.1+/3.6/3.7(64bit)**
***pip version 9.0.1+(64bit)**
***Visual Studio 2015 Update3**
## Choose a compilation method
## Choose CPU/GPU
We provide one compilation method under the Windows system:
* If your computer doesn't have NVIDIA® GPU, please install CPU version of PaddlePaddle
* Direct source code compilation
* If your computer has NVIDIA® GPU, and the following conditions are met,GPU version of PaddlePaddle is recommended.
***CUDA toolkit 9.0/9.1/9.2/10.0/10.1 with cuDNN v7.3+**
***GPU's computing capability exceeds 1.0**
Since the situation on host machine is more complicated, we only support specific systems.
## Installation steps
Please note: The current version does not support NCCL and distributed related functions.
There is one compilation methods in Windows system:
* Direct native source code compilation(NCCL, distributed and other related functions are not supported temporarily)
### ***Local compilation***
<aname="win_source"></a>
### ***Direct native source code compilation***
**Please strictly follow the following instructions step by step**
1.Check that your computer and operating system meet our supported compilation standards
1.Install the necessary tools i.e. cmake, git and python:
* Windows 10 Professional Edition / Enterprise Edition
> Cmake requires version 3.5 and above, which can be downloaded from the [official website](https://cmake.org/download/) and added to the environment variable.
* Visual Studio 2015 Update3
> Python requires version 2.7 and above, which can be downloaded from the [official website](https://www.python.org/download/releases/2.7/).
2. Install the necessary tools i.e. cmake, git and python :
* After installing python, please check whether the python version is the expected version by `python-version`, because you may have more than one python installed on your computer. You can handle conflicts of multiple pythons by changing the order of the environment variables.
> Cmake requires version 3.0 and above, which can be downloaded from the official website and added to the environment variable. [Download here](https://cmake.org/download/).
> `numpy, protobuf, wheel` are needed to be installed. Use the 'pip' command.
> Git can be downloaded on the official website and added to the environment variable. [Download here](https://gitforwindows.org/).
* To Install numpy package you can use command `pip install numpy`
> Python requires version 2.7 and above, and ensure that modules such as numpy, protobuf, wheel are installed. [Download here](https://www.python.org/download/releases/2.7/).
* To Install protobuf package you can use command `pip install protobuf`
* To Install Wheel package you can use command `pip install wheel`
* To Install numpy package you can use command `pip install numpy` or command `pip3 install numpy`
> Git can be downloaded on the [official website](https://gitforwindows.org/) and added to the environment variable.
* To Install protobuf package you can use command `pip install protobuf` or command `pip3 install protobuf`
2. Clone the PaddlePaddle source code to the Paddle subdirectories of the current directory and go to the Paddle subdirectories:
* To Install Wheel package you can use command `pip install wheel` or `pip3 install wheel`
7. Some third-party dependencies (openblas, snappystream) currently require users to provide pre-compiled versions, or download pre-compiled files from `https://github.com/wopeizl/Paddle_deps` and place the entire `third_party` folder in the `build` directory.
> -DPY_VERSION=3 (or 3.5、3.6、3.7)
8. Use Blend for Visual Studio 2015 to open `paddle.sln` file, select the platform `x64`, configure with `Release`, then begin to compile
If your device information contains multiple Python or CUDA, you can also specify a specific version of Python or CUDA by setting the corresponding compile options:
9. Having compiled successfully, go to the `\paddle\build\python\dist`directory and find the generated `.whl` package:
> -DPYTHON_EXECUTABLE: the installation path of python
`cd \paddle\build\python\dist`
> -DCUDA_TOOLKIT_ROOT_DIR: the installation path of CUDA
For example: (for instance only, please set it according to your actual installation path)
10. Install the compiled `.whl` package on the current machine or target machine:
6. Use Blend for Visual Studio 2015 to open `paddle.sln` file, select the platform `x64`, configure with `Release`, then begin to compile
Congratulations, now you have completed the process of compiling PaddlePaddle natively.
7. After compilation successfully, go to the `\paddle\build\python\dist` directory and find the generated `.whl` package:
`cd \paddle\build\python\dist`
8. Install the generated `.whl` package:
`pip install -U (whl package name)`
Congratulations, you have completed the process of compiling PaddlePaddle successfully!
### ***Verify installation***
After the installation is complete, you can use: `python` to enter the Python interpreter and then use `import paddle.fluid`. If there is no error prompted, the installation is successful.
After the compilation and installation is completed, you can use `python` to enter the Python interface, input `import paddle.fluid as fluid` and then `fluid.install_check.run_check()` to verify that the installation was successful.
If `Your Paddle Fluid is installed succesfully!` appears, it means the compilation and installation was successful.
### ***How to uninstall***
Please use the following command to uninstall PaddlePaddle:
****CPU version of PaddlePaddle*** : `pip uninstall paddlepaddle` or `pip3 uninstall paddlepaddle`
****CPU version of PaddlePaddle*** : `pip uninstall paddlepaddle`
****GPU version of PaddlePaddle*** : `pip uninstall paddlepaddle-gpu` or `pip3 uninstall paddlepaddle-gpu`
****GPU version of PaddlePaddle*** : `pip uninstall paddlepaddle-gpu`
This instruction will show you how to install PaddlePaddle on a *64-bit desktop or laptop* and MacOS system. The MacOS system we support must meet the following requirements.
## Environment preparation
Please note: Attempts on other systems may cause the installation to fail.
***MacOS version 10.11/10.12/10.13/10.14 (64 bit)(not support GPU version)**
***Python version 2.7.15+/3.5.1+/3.6/3.7 (64 bit)**
***pip or pip3 version 9.0.1+ (64 bit)**
* MacOS 10.11/10.12/10.13/10.14
### Note
## Determine which version to install
* Confirm that the Python where you need to install PaddlePaddle is your expected location, because your computer may have multiple Python
* Only PaddlePaddle for CPU is supported.
* If you are using Python 2, use the following command to output Python path. Depending on the environment, you may need to replace `python` in all command lines
which python
* If you are using Python 3, use the following command to output Python path. Depending on the environment, you may need to replace `python` in all command lines
## Choose an installation method
Under the MacOS system we offer 3 installation methods:
* Pip installation (not supported for GPU version) (distributed architecture is not supported under python3)
* Docker installation (the GPU version is not supported) (the version of python in the image is 2.7)
* Docker source compilation and installation (not supported for GPU version) (Python version 2.7, 3.5, 3.6, 3.7 in image)
**With pip installation** (the easiest way to install), we offer you a pip installation method, but it depends more on your local environment and may have some issues related to your local environment.
which python3
**Use Docker for installation** (the safest way to install), because we have installed the tools and configuration in a Docker image so that if something goes wrong, others can reproduce the problem for help. In addition, for developers accustomed to using Windows and MacOS, there is no need to configure a cross-compilation environment using Docker. It should be emphasized that Docker does not virtualize any hardware. The compiler tools running in the Docker container are actually running directly on the local CPU and operating system. The performance is the same as installing the compiler on the machine.
<br/><br/>
### ***Install using pip***
* You need to confirm whether the version of Python meets the requirements
Due to the large difference in Python situation in MacOS, we do not provide quick installation commands. Please follow the steps below to install.
* If you are using Python 2, use the following command to confirm that it is 2.7.15+
First, **check whether your computer and operating system** meet our supported compilation standards or not by `uname -m` and view the system version `About This Mac` in the Apple menu.
python --version
Second, your computer needs to meet the following requirements:
* If you are using Python 3, use the following command to confirm that it is 3.5.1+/3.6/3.7
> **Please do not use the Python originally provided by MacOS**. For **Python 2**, we recommend Python2.7.15 provided by [Homebrew](https://brew.sh/) or [Python.org](https://www.python.org/ftp/python/2.7.15/python-2.7.15-macosx10.9.pkg). For Python3, please use python3.5.x, Python3.6.x or python3.7.x provided by [Python.org](https://www.python.org/downloads/mac-osx/).
python3 --version
* It is required to confirm whether the pip version meets the requirements. The pip version is required to be 9.0.1+
For python2: brew install python@2 or use Python officially downloaded python2.7.15
For python3: Use python3.5.x, python3.6.x or python3.7.x downloaded from Python official site
* If you are using Python 2
python -m ensurepip
* Python2.7.x, Pip >= 9.0.1
python -m pip --version
* Python3.5.x, Pip3 >= 9.0.1
* If you are using Python 3
* Python3.6.x, Pip3 >= 9.0.1
python3 -m ensurepip
* Python3.7.x, Pip3 >= 9.0.1
python3 -m pip --version
> Note: You may have installed pip on your MacOS. Please use pip -V to confirm that its version is the recommended pip 9.0.1 or higher.
* Confirm that Python and pip is 64 bit,and the processor architecture is x86_64(or x64、Intel 64、AMD64)architecture. Currently, PaddlePaddle doesn't support arm64 architecture. The first line of output from the following command should be "64bit", and the second line should be "x86_64", "x64" or "AMD64".
* For users with **other requirements**: `pip install paddlepaddle==[version number]` or `pip3 install paddlepaddle==[version number]`
* The installation package provided by default requires computer support for MKL
> For `the version number`, please refer to [the latest Release installation package list](./Tables.html/#ciwhls-release). If you need to obtain and install **the latest PaddlePaddle development branch**, you can download the latest whl installation package and c-api development package from [the CI system](https://paddleci.ngrok.io/project.html?projectId=Manylinux1&tab=projectOverview) and install it. To log in, click on "Log in as guest".
Now you have completed the process of installing PaddlePaddle via `pip install`.
<br/><br/>
### ***Install using Docker***
## Choose CPU/GPU
In order to better use Docker and avoid problems, we recommend using **the highest version of Docker**. For details on **installing and using Docker**, please refer to [the official Docker documentation](https://docs.docker.com/install/).
* Currently, only the CPU version of PaddlePaddle is supported in the MacOS environment
Please note that running docker on MacOS requires logging in with your dockerID, otherwise an `Authenticate Failed` error will occur.
If Docker is **properly installed**, you can start **using Docker to install PaddlePaddle**.
1. Use the following command to pull the image we pre-installed for PaddlePaddle:
* For users who need **the CPU version of PaddlePaddle**, use the following command to pull the image we pre-installed for your *PaddlePaddle For CPU*:
> (Please replace [tag] with the contents of [the mirror table](./Tables.html/#dockers))
2. Use the following command to build from the already pulled image and enter the Docker container:
`Docker run --name [Name of container] -it -v $PWD:/paddle <imagename> /bin/bash`
## Choose an installation method
> In the above command, --name [Name of container] sets the name of the Docker; the -it parameter indicates that the container is running interactively with the host machine; -v $PWD:/paddle specifies the current path (the PWD variable in Linux will expand to [The absolute path](https://baike.baidu.com/item/绝对路径/481185) ) of the current path is mounted to the /paddle directory inside the container; `<imagename>` specifies the name of the image to use, if you need to use our image please use `hub.baidubce.com/paddlepaddle/paddle:[tag]`. Note: The meaning of tag is the same as the second step; /bin/bash is the command to be executed in Docker.
Under the MacOS system we offer 5 installation methods:
3. (Optional: When you need to enter the Docker container a second time) re-enter the PaddlePaddle container with the following command:
* Pip installation (recommend)
*[Conda installation](./install_Conda.html)
*[Docker installation](./install_Docker.html)
*[Source code compilation and installation](./compile/compile_MacOS.html#mac_source)
*[Docker source code compilation and installation](./compile/compile_MacOS.html#mac_docker)
`Docker start [Name of container]`
> start the container created previously.
We will introduce pip installation here.
`Docker attach [Name of container]`
## Installation steps
> Enter the started container.
* CPU version of PaddlePaddle:
* For Python 2: `python -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple` or `python -m pip install paddlepaddle -i https://pypi.tuna.tsinghua.edu.cn/simple`
* For Python 3: `python3 -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple` or `python3 -m pip install paddlepaddle -i https://pypi.tuna.tsinghua.edu.cn/simple`
Now that you have successfully installed PaddlePaddle using Docker, you only need to run PaddlePaddle after entering the Docker container. For more Docker usage, please refer to [the official Docker documentation](https://docs.docker.com/).
You can[Verify installation succeeded or not](#check), if you have any questions, please check[FAQ](./FAQ.html)
> Note: In order to reduce the size, `vim` is not installed in PaddlePaddle Docker image by default. You can edit the code in the container after executing `apt-get install -y vim` in the container.
Note:
* On MacOS you need to install unrar to support PaddlePaddle, you can use command `brew install unrar`
* For python2.7, we suggest command `python`; for python3.x, we suggest command `python3`
* Download the latest release installation package by default. To obtain the development installation package, please refer to [here](./Tables.html#ciwhls)
* Using Python native to MacOS can cause installation failures. For **Python2**,we recommend to use [Homebrew](https://brew.sh) or python2.7.15 provided by [Python.org](https://www.python.org/ftp/python/2.7.15/python-2.7.15-macosx10.9.pkg); for **Python3**, please use python3.5.x、python3.6.x or python3.7.x provided by [Python.org](https://www.python.org/downloads/mac-osx/).
<aname="check"></a>
<br/><br/>
## ***Verify installation***
After the installation is complete, you can use `python` or `python3` to enter the python interpreter and then use `import paddle.fluid` to verify that the installation was successful.
After the installation is completed, you can use `python` or `python3` to enter the Python interface, input `import paddle.fluid as fluid` and then `fluid.install_check.run_check()` to verify that the installation was successful.
If `Your Paddle Fluid is installed succesfully!` appears, it means the installation was successful.
<br/><br/>
## ***How to uninstall***
Please use the following command to uninstall PaddlePaddle (Users who use Docker to install PaddlePaddle should use the following command in the container containing PaddlePaddle. Please use the corresponding version of pip):
Please use the following command to uninstall PaddlePaddle:
****CPU version of PaddlePaddle***: `pip uninstall paddlepaddle` or `pip3 uninstall paddlepaddle`
**Windows 7/8/10 Pro/Enterprise(64bit)(CUDA 8.0/9.0/10.0 are supported, and only single GPU is supported)*
**Python 2.7.15+/3.5.1+/3.6/3.7(64bit)*
**pip or pip3 9.0.1+(64bit)*
***Windows 7/8/10 Pro/Enterprise(64bit)**
***GPU Version support CUDA 9.0/9.1/9.2/10.0/10.1, and only support single GPU**
***Python version 2.7.15+/3.5.1+/3.6/3.7(64bit)**
***pip version 9.0.1+(64bit)**
### Precautions
* The default installation package requires your computer to support AVX instruction set and MKL. If your environment doesn’t support AVX instruction set and MKL, please download [these](./Tables.html/#ciwhls-release)`no-avx`, `openblas` versions of installation package.
* The current version doesn’t support functions related to NCCL and distributed learning.
* Confirm the Python you install PaddlePaddle is the version you expected, because your computer may have more than one python, use the following command:
python --version
* If you are using Python 2, the output should be 2.7.15+
* If you are using Python 3, the output should be 3.5.1+/3.6+/3.7+
* If Python doesn't match your expected version, use the following command to see if Python's path is where you expect it to be:
where python
* If you are using Python 2, The installation directory for python2.7 should be on the first line
* If you are using Python 3, The installation directory for python3.5.1+/3.6+/3.7+ should be on the first line
* You can adjust it in any of the following ways:
* Use specific Python paths to execute commands(e.g. C:\Python36\python.exe corresponding to Python 3,C:\Python27\python.exe corresponding to Python 2)
* By modifying the environment variable, set your expected installation path in the first order (please modify it in control panel -> system properties -> environment variable -> path)
* Confirm whether the pip version meets the requirements. The pip version is required to be 9.0.1+
python -m ensurepip
python -m pip --version
* Confirm that Python and pip is 64 bit,and the processor architecture is x86_64(or x64、Intel 64、AMD64)architecture. Currently, PaddlePaddle doesn't support arm64 architecture. The first line of output from the following command should be "64bit", and the second line should be "x86_64", "x64" or "AMD64":
* The installation package provided by default requires the computer to support MKL. If your environment does not support MKL, please download the `openblas` version of the installation package in [here](./Tables.html#ciwhls-release)
* Nccl, distributed and other related functions are not supported in the current version.
## CPU or GPU
* If your computer doesn’t have NVIDIA® GPU, please install the CPU version of PaddlePaddle
* If your computer has NVIDIA® GPU, and it satisfies the following requirements, we recommend you to install the GPU version of PaddlePaddle
**CUDA Toolkit 8.0 with cuDNN v7.1+, or 9.0/10.0 with cuDNN v7.3+*
**CUDA Toolkit 9.0/10.0 with cuDNN v7.3+*
**GPU's computing capability exceeds 1.0*
Note: currently, the official Windows installation package only support CUDA 8.0/9.0/10.0 with single GPU, and don't support CUDA 9.1/9.2/10.1. if you need to use, please compile by yourself through the source code.
Note: currently, the official Windows installation package only support CUDA 9.0/10.0 with single GPU, and don't include CUDA 9.1/9.2/10.1. if you need to use, please compile by yourself through the source code.
Please refer to the NVIDIA official documents for the installation process and the configuration methods of [CUDA](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/) and [cuDNN](https://docs.nvidia.com/deeplearning/sdk/cudnn-install/).
...
...
@@ -33,26 +67,27 @@ There are 3 ways to install PaddlePaddle on Windows:
We would like to introduce the pip installation here.
## Installation Process
## Installation steps
* CPU version of PaddlePaddle:`pip install paddlepaddle` or `pip3 install paddlepaddle`
* GPU version of PaddlePaddle: `pip install paddlepaddle-gpu` or `pip3 install paddlepaddle-gpu`
* CPU version of PaddlePaddle:
*`python -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple`(Baidu source is recommended) or `python -m pip install paddlepaddle -i https://pypi.tuna.tsinghua.edu.cn/simple`
There is a checking function below for [verifyig whether the installation is successful](#check). If you have any further questions, please check the [FAQ part](./FAQ.html).
* GPU version of PaddlePaddle:
*`python -m pip install paddlepaddle-gpu -i https://mirror.baidu.com/pypi/simple`(Baidu source is recommended) or `python -m pip install paddlepaddle-gpu -i https://pypi.tuna.tsinghua.edu.cn/simple`
Notice:
There is a checking function below for [verifyig whether the installation is successful](#check). If you have any further questions, please check the [FAQ](./FAQ.html).
* The version of pip and the version of python should be corresponding: python2.7 corresponds to `pip`; python3.x corresponds to `pip3`.
*`pip install paddlepaddle-gpu` This command will install PaddlePaddle that supports CUDA 8.0(with cuDNN v7.1+), or CUDA 9.0/10.0(with cuDNN v7.3+).
Notice:
*`python -m pip install paddlepaddle-gpu -i https://pypi.tuna.tsinghua.edu.cn/simple` This command will install PaddlePaddle that supports CUDA 10.0(with cuDNN v7.3+). If you have different requirements for the version of CUDA or cuDNN, you can use command `python -m pip install paddlepaddle-gpu==[version number] -i https://pypi.tuna.tsinghua.edu.cn/simple` to install, and you can see the version [here](https://pypi.org/project/paddlepaddle-gpu#history). For the corresponding relations between PaddlePaddle and CUDA, cuDNN version, please see the [installer package list](./Tables.html#whls)
<aname="check"></a>
## Installation Verification
After completing the installation process, you can use `python`or `python3` to enter python interpreter and input `import paddle.fluid as fluid` and then `fluid.install_check.run_check()` to check whether the installation is successful.
After completing the installation process, you can use `python`to enter python interface and input `import paddle.fluid as fluid` and then `fluid.install_check.run_check()` to check whether the installation is successful.
If you see `Your Paddle Fluid is installed succesfully!`, your installation is verified successful.
## Uninstall PaddlePaddle
****CPU version of PaddlePaddle***: `pip uninstall paddlepaddle` or `pip3 uninstall paddlepaddle`
****CPU version of PaddlePaddle***: `python -m pip uninstall paddlepaddle`
****GPU version of PaddlePaddle***: `pip uninstall paddlepaddle-gpu` or `pip3 uninstall paddlepaddle-gpu`
****GPU version of PaddlePaddle***: `python -m pip uninstall paddlepaddle-gpu`