提交 2b4f62f9 编写于 作者: L LDOUBLEV

update install doc

上级 e2ed89fa
# 运行环境准备
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)
......@@ -8,6 +15,7 @@ Windows和Mac用户推荐使用Anaconda搭建Python环境,Linux用户建议使
+ [1.2 Mac](#1.2)
+ [1.3 Linux](#1.3)
* [2. 安装PaddlePaddle](#2)
* [3. 安装PaddleOCR依赖](#3)
<a name="1"></a>
......@@ -303,6 +311,14 @@ sudo nvidia-docker run --name ppocr -v $PWD:/paddle --shm-size=64G --network=hos
# ctrl+P+Q可退出docker 容器,重新进入docker 容器使用如下命令
sudo docker container exec -it ppocr /bin/bash
```
docker 环境中默认的python3 版本为python3.5,PaddleOCR 建议使用Python3.7,在执行python命令时,可以使用python3.7而不是python3。如下,输入python3.7命令并回车,可以看到使用的是python3.7版本。
```
λ root@Linux /paddle python3.7
Python 3.7.0 (default, Aug 2 2021, 05:30:22)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
```
<a name="2"></a>
......@@ -322,7 +338,26 @@ python3 -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
更多的版本需求,请参照[飞桨官网安装文档](https://www.paddlepaddle.org.cn/install/quick)中的说明进行操作。
<a name="3"></a>
## 3. 安装PaddleOCR依赖
下载paddleOCR 代码
```
【推荐】git clone https://github.com/PaddlePaddle/PaddleOCR
如果因为网络问题无法pull成功,也可选择使用码云上的托管:
git clone https://gitee.com/paddlepaddle/PaddleOCR
注:码云托管代码可能无法实时同步本github项目更新,存在3~5天延时,请优先使用推荐方式。
```
安装PaddleOCR 依赖
```
cd PaddleOCR
pip3 install -r requirements.txt
# docker 中使用pip3.7 代替pip3
# pip3.7 install -r requirements.txt
```
注意,windows环境下,建议从[这里](https://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely)下载shapely安装包完成安装, 直接通过pip安装的shapely库可能出现[winRrror 126] 找不到指定模块的问题。
# 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)
* [3. Install PaddleOCR Dependencies](#3)
<a name="1"></a>
......@@ -310,6 +318,25 @@ cd /home/Projects
# 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
# If using GPU, use nvidia-docker to create docker
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
```
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
```
The default python3 version in the docker environment is python3.5. Python3.7 is recommended to run PaddleOCR. When executing python commands, you can use python3.7 instead of python3. As follows, enter the python3.7 command and press Enter, you can see that the python3.7 version is used.
```
λ root@Linux /paddle python3.7
Python 3.7.0 (default, Aug 2 2021, 05:30:22)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
```
<a name="2"></a>
......@@ -330,3 +357,32 @@ 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.
## 3. Install PaddleOCR Dependencies
Download PaddleOCR code.
```
# Recommend
git clone https://github.com/PaddlePaddle/PaddleOCR
# If you cannot pull successfully due to network problems, you can also choose to use the code hosting on the cloud:
git clone https://gitee.com/paddlepaddle/PaddleOCR
# Note: The cloud-hosting code may not be able to synchronize the update with this GitHub project in real time. There might be a delay of 3-5 days. Please give priority to the recommended method.
```
Install third-party libraries
```
cd PaddleOCR
pip3 install -r requirements.txt
# use pip3.7 instead of pip3 in docker
# pip3.7 install -r requirements.txt
```
If you getting this error OSError: [WinError 126] The specified module could not be found when you install shapely on windows.
Please try to download Shapely whl file using [http://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely](http://www.lfd.uci.edu/~gohlke/pythonlibs/#shapely).
Reference: [Solve shapely installation on windows](https://stackoverflow.com/questions/44398265/install-shapely-oserror-winerror-126-the-specified-module-could-not-be-found)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册