Serving
Serving copied to clipboard
房价预测模型使用HTTP方式走不通
使用的是paddle serving v0.7.0,修改服务端没有--name,即python3 -m paddle_serving_server.serve --model uci_housing_model --thread 10 --port 9292,在客户端输入curl -H "Content-Type:application/json" -X POST -d '{"feed":[{"x": [0.0137, -0.1136, 0.2553, -0.0692, 0.0582, -0.0727, -0.1583, -0.0584, 0.6283, 0.4919, 0.1856, 0.0795, -0.0332]}], "fetch":["price"]}' http://127.0.0.1:9292/uci/prediction
结果出现
参考文档:https://github.com/PaddlePaddle/Serving/blob/v0.7.0/doc/Quick_Start_CN.md
您好,已经不支持--name 参数了,去掉--name就可以使用
您好,已经不支持--name 参数了,去掉--name就可以使用
你好,这边时已经去掉--name的,服务端正常打印日志,但是在客户端输入命令后出现的Fail to find method on ‘/uci/prediction'的问题该怎么解决
解决了么,Serving 0.7.0,Paddle 2.2.0依然是这个问题
很好奇 url里面的Uci这个参数从哪里来的?
1.如果要使用http://127.0.0.1:9292/uci/prediction这个url,请使用examples/C++/fit_a_line/test_server.py启动服务。 2.如果使用python3 -m paddle_serving_server.serve --model uci_housing_model --thread 10 --port 9292启动服务,请使用
curl -XPOST http://127.0.0.1:9292/GeneralModelService/inference -d '{"tensor":[{"float_data":[0.0137,-0.1136,0.2553,-0.0692,0.0582,-0.0727,-0.1583,-0.0584,0.6283,0.4919,0.1856,0.0795,-0.0332],"elem_type":1,"name":"x","alias_name":"x","shape":[1,13]}],"fetch_var_names":["price"],"log_id":0}'
请求服务。具体的说明https://github.com/PaddlePaddle/Serving/blob/v0.9.0/doc/C%2B%2B_Serving/Http_Service_CN.md。 我也在这卡了好久。找了好久才找到。希望能帮到你。
1.如果要使用http://127.0.0.1:9292/uci/prediction这个url,请使用examples/C++/fit_a_line/test_server.py启动服务。 2.如果使用python3 -m paddle_serving_server.serve --model uci_housing_model --thread 10 --port 9292启动服务,请使用
curl -XPOST http://127.0.0.1:9292/GeneralModelService/inference -d '{"tensor":[{"float_data":[0.0137,-0.1136,0.2553,-0.0692,0.0582,-0.0727,-0.1583,-0.0584,0.6283,0.4919,0.1856,0.0795,-0.0332],"elem_type":1,"name":"x","alias_name":"x","shape":[1,13]}],"fetch_var_names":["price"],"log_id":0}'
请求服务。具体的说明https://github.com/PaddlePaddle/Serving/blob/v0.9.0/doc/C%2B%2B_Serving/Http_Service_CN.md。 我也在这卡了好久。找了好久才找到。希望能帮到你。
被官方文档误导了