From d24aa0f408fee5a107eb4db0a7728027b9959c5f Mon Sep 17 00:00:00 2001 From: dingxl Date: Sun, 19 Jun 2022 12:21:56 +0800 Subject: [PATCH 1/4] Dockerfile pull code fails, use gitee instead of Github. --- deploy/docker/hubserving/cpu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/docker/hubserving/cpu/Dockerfile b/deploy/docker/hubserving/cpu/Dockerfile index ef1a7b7b16..959f01b0c7 100644 --- a/deploy/docker/hubserving/cpu/Dockerfile +++ b/deploy/docker/hubserving/cpu/Dockerfile @@ -6,7 +6,7 @@ RUN pip3.7 install --upgrade pip -i https://mirror.baidu.com/pypi/simple RUN pip3.7 install paddlehub --upgrade -i https://mirror.baidu.com/pypi/simple -RUN git clone https://github.com/PaddlePaddle/PaddleOCR.git /PaddleOCR +RUN git clone https://gitee.com/PaddlePaddle/PaddleOCR.git /PaddleOCR WORKDIR /PaddleOCR -- Gitee From f43d2ecafc41aff51eb75cd1829df2ab798636aa Mon Sep 17 00:00:00 2001 From: dingxl Date: Sun, 19 Jun 2022 12:23:49 +0800 Subject: [PATCH 2/4] Dockerfile doesn't use config.json to specify use.gpn and port. Set the right parameter and config.json path. --- deploy/docker/hubserving/cpu/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/docker/hubserving/cpu/Dockerfile b/deploy/docker/hubserving/cpu/Dockerfile index 959f01b0c7..56eedbb83d 100644 --- a/deploy/docker/hubserving/cpu/Dockerfile +++ b/deploy/docker/hubserving/cpu/Dockerfile @@ -27,4 +27,4 @@ RUN tar xf /PaddleOCR/inference/{file}.tar -C /PaddleOCR/inference/ EXPOSE 8868 -CMD ["/bin/bash","-c","hub install deploy/hubserving/ocr_system/ && hub serving start -m ocr_system"] \ No newline at end of file +CMD ["/bin/bash","-c","hub install deploy/hubserving/ocr_system/ && hub serving start -c /PaddleOCR/deploy/hubserving/ocr_system/config.json"] \ No newline at end of file -- Gitee From 5cbfbb90e5af558c55c88853ad4ba391c6f82efc Mon Sep 17 00:00:00 2001 From: dingxl Date: Sun, 19 Jun 2022 12:26:32 +0800 Subject: [PATCH 3/4] Fix error when launch paddle ocr system. Specify the versions of paddlepaddle and paddlenlp --- deploy/docker/hubserving/cpu/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deploy/docker/hubserving/cpu/Dockerfile b/deploy/docker/hubserving/cpu/Dockerfile index 56eedbb83d..90e874f004 100644 --- a/deploy/docker/hubserving/cpu/Dockerfile +++ b/deploy/docker/hubserving/cpu/Dockerfile @@ -4,6 +4,10 @@ FROM registry.baidubce.com/paddlepaddle/paddle:2.0.0 # PaddleOCR base on Python3.7 RUN pip3.7 install --upgrade pip -i https://mirror.baidu.com/pypi/simple +# Fix error: versions don't match. Use the specified versions of paddlepaddle and paddlenlp. +RUN pip3.7 install paddlepaddle==2.1.0 -i https://mirror.baidu.com/pypi/simple +RUN pip3.7 install paddlenlp==2.0.2 -i https://mirror.baidu.com/pypi/simple + RUN pip3.7 install paddlehub --upgrade -i https://mirror.baidu.com/pypi/simple RUN git clone https://gitee.com/PaddlePaddle/PaddleOCR.git /PaddleOCR -- Gitee From 5807684d5911b2a40fe6f7b983274340e10aa4a7 Mon Sep 17 00:00:00 2001 From: dingxl Date: Sun, 19 Jun 2022 12:28:44 +0800 Subject: [PATCH 4/4] Dockerfile updates: switch code branch to avoid the mismatched version. --- deploy/docker/hubserving/cpu/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deploy/docker/hubserving/cpu/Dockerfile b/deploy/docker/hubserving/cpu/Dockerfile index 90e874f004..65e93f5ddb 100644 --- a/deploy/docker/hubserving/cpu/Dockerfile +++ b/deploy/docker/hubserving/cpu/Dockerfile @@ -14,6 +14,9 @@ RUN git clone https://gitee.com/PaddlePaddle/PaddleOCR.git /PaddleOCR WORKDIR /PaddleOCR +# Switch code branch to avoid the mismatched versions. +RUN git checkout release/2.5 + RUN pip3.7 install -r requirements.txt -i https://mirror.baidu.com/pypi/simple RUN mkdir -p /PaddleOCR/inference/ -- Gitee