diff --git a/doc/doc_ch/environment.md b/doc/doc_ch/environment.md index a55008100312f50e0786dca49eaa186afc49b3b2..3a266c4bb8fe5516f844bea9f0aa21359d51660e 100644 --- a/doc/doc_ch/environment.md +++ b/doc/doc_ch/environment.md @@ -1,6 +1,13 @@ # 运行环境准备 + Windows和Mac用户推荐使用Anaconda搭建Python环境,Linux用户建议使用docker搭建PyThon环境。 +推荐环境: +- PaddlePaddle >= 2.0.0 (2.1.2) +- python3.7 +- CUDA10.1 / CUDA10.2 +- CUDNN 7.6 + 如果对于Python环境熟悉的用户可以直接跳到第2步安装PaddlePaddle。 * [1. Python环境搭建](#1) @@ -123,13 +130,13 @@ Windows和Mac用户推荐使用Anaconda搭建Python环境,Linux用户建议使 # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/Users/xxx/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then - eval "$__conda_setup" + eval "$__conda_setup" else - if [ -f "/Users/xxx/opt/anaconda3/etc/profile.d/conda.sh" ]; then - . "/Users/xxx/opt/anaconda3/etc/profile.d/conda.sh" - else - export PATH="/Users/xxx/opt/anaconda3/bin:$PATH" - fi + if [ -f "/Users/xxx/opt/anaconda3/etc/profile.d/conda.sh" ]; then + . "/Users/xxx/opt/anaconda3/etc/profile.d/conda.sh" + else + export PATH="/Users/xxx/opt/anaconda3/bin:$PATH" + fi fi unset __conda_setup # <<< conda initialize <<< @@ -294,11 +301,12 @@ cd /home/Projects # 首次运行需创建一个docker容器,再次运行时不需要运行当前命令 # 创建一个名字为ppocr的docker容器,并将当前目录映射到容器的/paddle目录下 -如果您希望在CPU环境下使用docker,使用docker而不是nvidia-docker创建docker -sudo docker run --name ppocr -v $PWD:/paddle --network=host -it paddlepaddle/paddle:latest-dev-cuda10.1-cudnn7-gcc82 /bin/bash +#如果您希望在CPU环境下使用docker,使用docker而不是nvidia-docker创建docker +sudo docker run --name ppocr -v $PWD:/paddle --network=host -it registry.baidubce.com/paddlepaddle/paddle:2.1.3-gpu-cuda10.2-cudnn7 /bin/bash -如果使用CUDA10,请运行以下命令创建容器,设置docker容器共享内存shm-size为64G,建议设置32G以上 -sudo nvidia-docker run --name ppocr -v $PWD:/paddle --shm-size=64G --network=host -it paddlepaddle/paddle:latest-dev-cuda10.1-cudnn7-gcc82 /bin/bash +#如果使用CUDA10,请运行以下命令创建容器,设置docker容器共享内存shm-size为64G,建议设置32G以上 +# 如果是CUDA11+CUDNN8,推荐使用镜像registry.baidubce.com/paddlepaddle/paddle:2.1.3-gpu-cuda11.2-cudnn8 +sudo nvidia-docker run --name ppocr -v $PWD:/paddle --shm-size=64G --network=host -it registry.baidubce.com/paddlepaddle/paddle:2.1.3-gpu-cuda10.2-cudnn7 /bin/bash # ctrl+P+Q可退出docker 容器,重新进入docker 容器使用如下命令 sudo docker container exec -it ppocr /bin/bash @@ -321,8 +329,3 @@ python3 -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple ``` 更多的版本需求,请参照[飞桨官网安装文档](https://www.paddlepaddle.org.cn/install/quick)中的说明进行操作。 - - - - - diff --git a/doc/doc_en/environment_en.md b/doc/doc_en/environment_en.md index 96a46cce3010934689e8d95985ca434f49d18886..9aad92cafb809a0eec519808b1c1755403b39318 100644 --- a/doc/doc_en/environment_en.md +++ b/doc/doc_en/environment_en.md @@ -1,11 +1,18 @@ # Environment Preparation +Recommended working environment: +- PaddlePaddle >= 2.0.0 (2.1.2) +- python3.7 +- CUDA10.1 / CUDA10.2 +- CUDNN 7.6 + * [1. Python Environment Setup](#1) + [1.1 Windows](#1.1) + [1.2 Mac](#1.2) + [1.3 Linux](#1.3) * [2. Install PaddlePaddle 2.0](#2) + ## 1. Python Environment Setup @@ -38,7 +45,7 @@ - Check conda to add environment variables and ignore the warning that add conda to path - + #### 1.1.2 Opening the terminal and creating the conda environment @@ -69,7 +76,7 @@ # View the current location of python where python ``` - + create environment The above anaconda environment and python environment are installed @@ -133,13 +140,13 @@ The above anaconda environment and python environment are installed # !!! Contents within this block are managed by 'conda init' !!! __conda_setup="$('/Users/xxx/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then - eval "$__conda_setup" + eval "$__conda_setup" else - if [ -f "/Users/xxx/opt/anaconda3/etc/profile.d/conda.sh" ]; then - . "/Users/xxx/opt/anaconda3/etc/profile.d/conda.sh" - else - export PATH="/Users/xxx/opt/anaconda3/bin:$PATH" - fi + if [ -f "/Users/xxx/opt/anaconda3/etc/profile.d/conda.sh" ]; then + . "/Users/xxx/opt/anaconda3/etc/profile.d/conda.sh" + else + export PATH="/Users/xxx/opt/anaconda3/bin:$PATH" + fi fi unset __conda_setup # <<< conda initialize <<< @@ -197,11 +204,10 @@ Linux users can choose to run either Anaconda or Docker. If you are familiar wit - **Download Anaconda**. - Download at: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=M&O=D - + - - Select the appropriate version for your operating system - Type `uname -m` in the terminal to check the command set used by your system @@ -216,12 +222,12 @@ Linux users can choose to run either Anaconda or Docker. If you are familiar wit sudo yum install wget # CentOS ``` ```bash - # Then use wget to download from Tsinghua source + # Then use wget to download from Tsinghua source # If you want to download Anaconda3-2021.05-Linux-x86_64.sh, the download command is as follows wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2021.05-Linux-x86_64.sh # If you want to download another version, you need to change the file name after the last 1 / to the version you want to download ``` - + - To install Anaconda. - Type `sh Anaconda3-2021.05-Linux-x86_64.sh` at the command line @@ -309,7 +315,18 @@ cd /home/Projects # Create a docker container named ppocr and map the current directory to the /paddle directory of the container # If using CPU, use docker instead of nvidia-docker to create docker -sudo docker run --name ppocr -v $PWD:/paddle --network=host -it paddlepaddle/paddle:latest-dev-cuda10.1-cudnn7-gcc82 /bin/bash +sudo docker run --name ppocr -v $PWD:/paddle --network=host -it registry.baidubce.com/paddlepaddle/paddle:2.1.3-gpu-cuda10.2-cudnn7 /bin/bash + +# If using GPU, use nvidia-docker to create docker +# docker image registry.baidubce.com/paddlepaddle/paddle:2.1.3-gpu-cuda11.2-cudnn8 is recommended for CUDA11.2 + CUDNN8. +sudo nvidia-docker run --name ppocr -v $PWD:/paddle --shm-size=64G --network=host -it registry.baidubce.com/paddlepaddle/paddle:2.1.3-gpu-cuda10.2-cudnn7 /bin/bash + +``` +You can also visit [DockerHub](https://hub.docker.com/r/paddlepaddle/paddle/tags/) to get the image that fits your machine. + +``` +# ctrl+P+Q to exit docker, to re-enter docker using the following command: +sudo docker container exec -it ppocr /bin/bash ``` @@ -329,4 +346,3 @@ python3 -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple ``` For more software version requirements, please refer to the instructions in [Installation Document](https://www.paddlepaddle.org.cn/install/quick) for operation. -