Serving GPU镜像编译二进制问题
Created by: levinxo
使用最新的镜像hub.baidubce.com/paddlepaddle/serving:latest-gpu-devel
作为环境进行编译,编译过程中遇到错误:
c++: error: unrecognized command line option '-Wimplicit-fallthrough=0'
升级cmake到3.3.0,gcc到9.x之后解决。
另外一个错误:
cc1plus: error: -Werror=parentheses-equality: no option -Wparentheses-equality
将cmake/flags.cmake里的-Wparentheses-equality
修改为-Wparentheses
解决。
再遇到一个错误:
-- Installing: /Serving/server-build-gpu/third_party/install/brpc/lib/pkgconfig/brpc.pc
-- Installing: /Serving/server-build-gpu/third_party/install/brpc/lib/libbrpc.so
-- Installing: /Serving/server-build-gpu/third_party/install/brpc/lib/libbrpc.a
[ 47%] Completed 'extern_brpc'
[ 47%] Built target extern_brpc
make: *** [all] Error 2
将cmake/flags.cmake里的set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
改为set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -lpthread")
解决
还有以下错误,安装和升级对应pip库即可:
[100%] Generating ../.timestamp
Traceback (most recent call last):
File "setup.py", line 24, in <module>
from paddle_serving_server_gpu.version import serving_server_version
File "/jiangjiajun/Serving/server-build-gpu/python/paddle_serving_server_gpu/__init__.py", line 30, in <module>
import numpy as np
ModuleNotFoundError: No module named 'numpy'
Traceback (most recent call last):
File "setup.py", line 24, in <module>
from paddle_serving_server_gpu.version import serving_server_version
File "/jiangjiajun/Serving/server-build-gpu/python/paddle_serving_server_gpu/__init__.py", line 32, in <module>
from .proto import multi_lang_general_model_service_pb2
File "/jiangjiajun/Serving/server-build-gpu/python/paddle_serving_server_gpu/proto/multi_lang_general_model_service_pb2.py", line 21, in <module>
create_key=_descriptor._internal_create_key,
AttributeError: module 'google.protobuf.descriptor' has no attribute '_internal_create_key'
pip3 install --upgrade pip && \
pip3 uninstall protobuf && \
pip3 install grpcio-tools -i https://mirrors.aliyun.com/pypi/simple/ &&\
pip3 install numpy -i https://mirrors.aliyun.com/pypi/simple/ && \
pip3 install --upgrade protobuf -i https://mirrors.aliyun.com/pypi/simple/