installation.md 3.73 KB
Newer Older
1
## Quick installation
2

3
4
After testing PaddleOCR can run on glibc 2.23, you can also test other glibc versions or install glic 2.23
PaddleOCR working environment
LDOUBLEV's avatar
LDOUBLEV committed
5
6
7
8
- PaddlePaddle1.7
- python3
- glibc 2.23

9
It is recommended to use the docker provided by us to run PaddleOCR, please refer to the use of docker [link](https://docs.docker.com/get-started/).
LDOUBLEV's avatar
LDOUBLEV committed
10

11
1. (Recommended) Prepare a docker environment. The first time you use this image, it will be downloaded automatically. Please be patient.
12
```
13
# Switch to the working directory
14
cd /home/Projects
15
16
# You need to create a docker container for the first run, and do not need to run the current command when you run it again
# Create a docker container named ppocr and map the current directory to the /paddle directory of the container
dyning's avatar
dyning committed
17

18
If you want to use docker in a CPU environment, use docker instead of nvidia-docker to create docker
19
sudo docker run --name ppocr -v $PWD:/paddle --network=host -it hub.baidubce.com/paddlepaddle/paddle:latest-gpu-cuda9.0-cudnn7-dev /bin/bash
20
21
22
```
If your machine is installed CUDA9, please run the following command to create a container
```
dyning's avatar
dyning committed
23
sudo nvidia-docker run --name ppocr -v $PWD:/paddle --network=host -it hub.baidubce.com/paddlepaddle/paddle:latest-gpu-cuda9.0-cudnn7-dev /bin/bash
24
25
26
```
If your machine is installed with CUDA10, please run the following command to create a container
```
dyning's avatar
dyning committed
27
sudo nvidia-docker run --name ppocr -v $PWD:/paddle --network=host -it hub.baidubce.com/paddlepaddle/paddle:latest-gpu-cuda10.0-cudnn7-dev /bin/bash
28
29
30
31
```
You can also visit [DockerHub](https://hub.docker.com/r/paddlepaddle/paddle/tags/) to get the image that fits your machine.
```
# ctrl+P+Q can exit docker and re-enter docker using the following command
32
sudo docker container exec -it ppocr /bin/bash
dyning's avatar
dyning committed
33
34
```

35
Note: if docker pull is too slow, you can manually download and load docker according to the following steps. Taking cuda9 docker as an example, using cuda10 docker only needs to change cuda9 to cuda10
LDOUBLEV's avatar
LDOUBLEV committed
36
```
37
# Download the CUDA9 docker compressed file and unzip it
LDOUBLEV's avatar
LDOUBLEV committed
38
wget https://paddleocr.bj.bcebos.com/docker/docker_pdocr_cuda9.tar.gz
39
# To reduce download time, the uploaded docker image is compressed and needs to be decompressed
LDOUBLEV's avatar
LDOUBLEV committed
40
tar zxf docker_pdocr_cuda9.tar.gz
41
# Create image
LDOUBLEV's avatar
LDOUBLEV committed
42
docker load < docker_pdocr_cuda9.tar
43
# After completing the above steps, check whether the downloaded image is loaded through docker images
LDOUBLEV's avatar
LDOUBLEV committed
44
docker images
45
# If you have the following output after executing docker images, you can follow step 1 to create a docker environment.
LDOUBLEV's avatar
LDOUBLEV committed
46
47
48
hub.baidubce.com/paddlepaddle/paddle   latest-gpu-cuda9.0-cudnn7-dev    f56310dcc829
```

49
2. Install PaddlePaddle Fluid v1.7 (the higher version is not supported yet, the adaptation work is in progress)
dyning's avatar
dyning committed
50
51
52
```
pip3 install --upgrade pip

53
# If your machine is installed CUDA9, please run the following command to install
dyning's avatar
dyning committed
54
python3 -m pip install paddlepaddle-gpu==1.7.2.post97 -i https://pypi.tuna.tsinghua.edu.cn/simple
LDOUBLEV's avatar
LDOUBLEV committed
55

56
# If your machine is installed CUDA10, please run the following command to install
dyning's avatar
dyning committed
57
python3 -m pip install paddlepaddle-gpu==1.7.2.post107 -i https://pypi.tuna.tsinghua.edu.cn/simple
58
```
59
60
For more version requirements, please refer to the instructions in [Installation Document](https://www.paddlepaddle.org.cn/install/quick) for operation.

61

62
3. Clone PaddleOCR repo code
63
```
64
65
# Recommend
git clone https://github.com/PaddlePaddle/PaddleOCR
dyning's avatar
dyning committed
66

67
# If you cannot pull because of network problems, you can also choose to use the hosting on the code cloud:
dyning's avatar
dyning committed
68
69
70

git clone https://gitee.com/paddlepaddle/PaddleOCR

71
# Note: Code cloud hosting code may not be able to synchronize this github project update in real time, there is a delay of 3~5 days, please use the recommended method first.
72
73
```

74
4. Install third-party libraries
75
76
```
cd PaddleOCR
dyning's avatar
dyning committed
77
pip3 install -r requirments.txt
78
```