docker容器中,HTTP和RPC服务进行bert模型预测时报错
Created by: ClassmateXiaoyu
基本环境是按照文档pull的hub.baidubce.com/paddlepaddle/serving:0.2.0镜像,Windows7 64位环境下安装的docker。容器中安装的0.2.1版本的的client和server。安装后,uci_housing模型可以正常HTTP和RPC预测。但是用bert模型进行测试时有报错,内容如下。HTTP报错{"result":"Request Value Error"}可能是由于传入的数据不对,RPC的报错Illegal instruction (core dumped)。 代码如下:
RPC服务:
[root@23130a8f27e7 project_bert_seq20]# python -m paddle_serving_server.serve --model bert_seq20_model --port 9292 --thread 4 &>bert_log.txt &
[1] 1358
[root@23130a8f27e7 project_bert_seq20]# cat data-c.txt | python bert_seq20_rpc.py
WARNING: Logging before InitGoogleLogging() is written to STDERR
E0511 07:55:05.645292 1378 config_manager.cpp:217] Not found key in configue: cluster
E0511 07:55:05.646639 1378 config_manager.cpp:234] Not found key in configue: split_tag_name
E0511 07:55:05.647294 1378 config_manager.cpp:235] Not found key in configue: tag_candidates
E0511 07:55:05.647946 1378 config_manager.cpp:202] Not found key in configue: connect_timeout_ms
E0511 07:55:05.648443 1378 config_manager.cpp:203] Not found key in configue: rpc_timeout_ms
E0511 07:55:05.649521 1378 config_manager.cpp:205] Not found key in configue: hedge_request_timeout_ms
E0511 07:55:05.650112 1378 config_manager.cpp:207] Not found key in configue: connect_retry_count
E0511 07:55:05.650581 1378 config_manager.cpp:209] Not found key in configue: hedge_fetch_retry_count
E0511 07:55:05.651515 1378 config_manager.cpp:211] Not found key in configue: max_connection_per_host
E0511 07:55:05.652343 1378 config_manager.cpp:212] Not found key in configue: connection_type
E0511 07:55:05.652875 1378 config_manager.cpp:219] Not found key in configue: load_balance_strategy
E0511 07:55:05.653631 1378 config_manager.cpp:221] Not found key in configue: cluster_filter_strategy
E0511 07:55:05.654289 1378 config_manager.cpp:226] Not found key in configue: protocol
E0511 07:55:05.654405 1378 config_manager.cpp:227] Not found key in configue: compress_type
E0511 07:55:05.654548 1378 config_manager.cpp:228] Not found key in configue: package_size
E0511 07:55:05.654673 1378 config_manager.cpp:230] Not found key in configue: max_channel_per_request
E0511 07:55:05.655035 1378 config_manager.cpp:234] Not found key in configue: split_tag_name
E0511 07:55:05.655126 1378 config_manager.cpp:235] Not found key in configue: tag_candidates
I0511 07:55:05.664395 1378 naming_service_thread.cpp:209] brpc::policy::ListNamingService("127.0.0.1:9292"): added 1
Illegal instruction (core dumped)
HTTP服务:
[root@23130a8f27e7 project_bert_seq20]# python -m paddle_serving_server.serve --model bert_seq20_model --port 9292 --thread 4 --name bert &>bert_log.txt &
[1] 1404
[root@23130a8f27e7 project_bert_seq20]# curl -H "Content-Type:application/json" -X POST -d '{"feed":[{"words": "great"}], "fetch":["pooled_output"]}' http://0.0.0.0:9292/bert/prediction
{"result":"Request Value Error"}