[2022-05-10 12:06:31] The conflict is caused by: [2022-05-10 12:06:31] paddle-serving-server-gpu 0.8.3.post101 depends on grpcio<=1.33.2 [2022-05-10 12:06:31] paddle-serving-client 0.8.3 depends on grpcio<=1.33.2 [2022-05-10 12:06:31] pymilvus 2.0.2 depends on grpcio==1.37.1 [2022-05-10 12:06:31] [2022-05-10 12:06:31] To fix this you could try to: [2022-05-10 12:06:31] 1. loosen the range of package versions you've specified [2022-05-10 12:06:31] 2. remove package versions to allow pip attempt to solve the dependency解决方案,重新Serving编包
参考文件:https://github.com/PaddlePaddle/Serving/blob/v0.8.3/doc/Compile_CN.md
修改requirements.txt和编译参数中grpc版本依赖,重新Serving编包
修改requirements.txt和 go install google.golang.org/grpc@v1.33.0,都改成高版本
编译出来的包是0.0.0.0,不需要上传到pypi了,自己用就行
docker pull registry.baidubce.com/paddlepaddle/serving:0.8.0-cuda10.1-cudnn7-devel # 如果是GPU镜像 nvidia-docker run --rm -it registry.baidubce.com/paddlepaddle/serving:0.8.0-cuda10.1-cudnn7-devel bash2、下载代码库
子模块,讲解:https://blog.csdn.net/guotianqing/article/details/82391665
git clone https://github.com/PaddlePaddle/Serving cd Serving && git submodule update --init --recursive3、环境变量准备 1、设置PYTHON环境变量 1、设置PYTHON_INCLUDE_DIR
find / -name Python.h
export PYTHON_INCLUDE_DIR=/usr/local/include/python3.7m/2、设置PYTHON_LIBRARIES
find / -name libpython3.7.so find / -name libpython3.7m.so
export PYTHON_LIBRARIES=/usr/local/lib3、设置PYTHON_EXECUTABLE
which python3.7
export PYTHON_EXECUTABLE=/usr/local/bin/python3.74、更改requirements.txt
cd python vim requirements.txt i :wq cd ..5、配置安装
export GOPATH=$HOME/go export PATH=$PATH:$GOPATH/bin
python3.7 -m pip install -r python/requirements.txt
go env -w GO111MODULE=on go env -w GOPROXY=https://goproxy.cn,direct go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v1.15.2 go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@v1.15.2 go install github.com/golang/protobuf/protoc-gen-go@v1.4.3 go install google.golang.org/grpc@v1.37.1 go env -w GO111MODULE=auto6、配置GPU
export CUDA_PATH='/usr/local/cuda' export CUDNN_LIBRARY='/usr/local/cuda/lib64/' export CUDA_CUDART_LIBRARY="/usr/local/cuda/lib64/" export TENSORRT_LIBRARY_PATH="/usr/"7、编译paddle-serving-server
mkdir build_server
cd build_server
cmake -DPYTHON_INCLUDE_DIR=$PYTHON_INCLUDE_DIR
-DPYTHON_LIBRARIES=$PYTHON_LIBRARIES
-DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE
-DCUDA_TOOLKIT_ROOT_DIR=${CUDA_PATH}
-DCUDNN_LIBRARY=${CUDNN_LIBRARY}
-DCUDA_CUDART_LIBRARY=${CUDA_CUDART_LIBRARY}
-DTENSORRT_ROOT=${TENSORRT_LIBRARY_PATH}
-DSERVER=ON
-DWITH_GPU=ON ..
make -j20
cd ..
8、编译paddle-serving-client 和 paddle-serving-app
# 编译paddle-serving-client
mkdir build_client
cd build_client
cmake -DPYTHON_INCLUDE_DIR=$PYTHON_INCLUDE_DIR
-DPYTHON_LIBRARIES=$PYTHON_LIBRARIES
-DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE
-DCLIENT=ON ..
make -j10
cd ..
# 编译paddle-serving-app
mkdir build_app
cd build_app
cmake -DPYTHON_INCLUDE_DIR=$PYTHON_INCLUDE_DIR
-DPYTHON_LIBRARIES=$PYTHON_LIBRARIES
-DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE
-DAPP=ON ..
make -j10
cd ..
9、安装相关whl包
pip3.7 install build_server/python/dist/*.whl
pip3.7 install build_client/python/dist/*.whl
pip3.7 install build_app/python/dist/*.whl
export SERVING_BIN=${PWD}/build_server/core/general-server/serving
安装过程报错
CMakeFiles/extern_snappy.dir/build.make:90: recipe for target 'third_party/snappy/src/extern_snappy-stamp/extern_snappy-download' failed
make[2]: *** [third_party/snappy/src/extern_snappy-stamp/extern_snappy-download] Error 1
CMakeFiles/Makefile2:676: recipe for target 'CMakeFiles/extern_snappy.dir/all' failed
make[1]: *** [CMakeFiles/extern_snappy.dir/all] Error 2
CMakeFiles/extern_utf8proc.dir/build.make:90: recipe for target 'third_party/utf8proc/src/extern_utf8proc-stamp/extern_utf8proc-download' failed
make[2]: *** [third_party/utf8proc/src/extern_utf8proc-stamp/extern_utf8proc-download] Error 1
CMakeFiles/Makefile2:622: recipe for target 'CMakeFiles/extern_utf8proc.dir/all' failed
make[1]: *** [CMakeFiles/extern_utf8proc.dir/all] Error 2
fatal: unable to access 'https://github.com/gflags/gflags.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
-- Had to git clone more than once:
3 times.
CMake Error at /home/Serving/build_server/third_party/gflags/tmp/extern_gflags-gitclone.cmake:31 (message):
Failed to clone repository: 'https://github.com/gflags/gflags.git'
CMakeFiles/extern_gflags.dir/build.make:90: recipe for target 'third_party/gflags/src/extern_gflags-stamp/extern_gflags-download' failed
make[2]: *** [third_party/gflags/src/extern_gflags-stamp/extern_gflags-download] Error 1
CMakeFiles/Makefile2:757: recipe for target 'CMakeFiles/extern_gflags.dir/all' failed
make[1]: *** [CMakeFiles/extern_gflags.dir/all] Error 2
fatal: unable to access 'https://github.com/pybind/pybind11.git/': Failed to connect to github.com port 443: Connection timed out
fatal: unable to access 'https://github.com/madler/zlib.git/': Failed to connect to github.com port 443: Connection timed out
-- Had to git clone more than once:
3 times.
CMake Error at /home/Serving/build_server/third_party/pybind/tmp/extern_pybind-gitclone.cmake:31 (message):
Failed to clone repository: 'https://github.com/pybind/pybind11.git'
-- Had to git clone more than once:
3 times.
CMake Error at /home/Serving/build_server/third_party/zlib/tmp/extern_zlib-gitclone.cmake:31 (message):
Failed to clone repository: 'https://github.com/madler/zlib.git'
CMakeFiles/extern_pybind.dir/build.make:91: recipe for target 'third_party/pybind/src/extern_pybind-stamp/extern_pybind-download' failed
make[2]: *** [third_party/pybind/src/extern_pybind-stamp/extern_pybind-download] Error 1
CMakeFiles/Makefile2:541: recipe for target 'CMakeFiles/extern_pybind.dir/all' failed
make[1]: *** [CMakeFiles/extern_pybind.dir/all] Error 2
CMakeFiles/extern_zlib.dir/build.make:90: recipe for target 'third_party/zlib/src/extern_zlib-stamp/extern_zlib-download' failed
make[2]: *** [third_party/zlib/src/extern_zlib-stamp/extern_zlib-download] Error 1
CMakeFiles/Makefile2:730: recipe for target 'CMakeFiles/extern_zlib.dir/all' failed
make[1]: *** [CMakeFiles/extern_zlib.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
解决方案
https://github.com/
换成
https://github.91chi.fun//https://github.com/



