Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paddleServing 安装需要安装docker吗 paddlex发布完成如果通过paddleserving 调用http调用 #474

Closed
wyc880622 opened this issue Apr 23, 2020 · 4 comments
Assignees

Comments

@wyc880622
Copy link

1.我发布完的paddlex的模型,我想通过http调用进行预测。
2.我文章可以直接安装paddleserving,但文章后面链接到此项目,需要安装docker在安装paddleserving。
https://paddlepaddle.org.cn/support/news?action=detail&id=1945
我现在想知道如何快速的将paddleserving安装并发布我的paddlex的模型。
谢谢

@github-actions
Copy link

Message that will be displayed on users' first issue

@bjjwwang
Copy link
Collaborator

您可以将paddleX训练出来的模型 docker cp到容器里面。参考这个文档
https://github.com/PaddlePaddle/Serving/blob/develop/doc/RUN_IN_DOCKER_CN.md

这个时候是Paddle模型,还不具备上线的能力,需要做如下的转换

# filename: trans_model.py
import os
import time
import sys
import paddle.fluid as fluid
import paddle_serving_client.io as serving_io

path = sys.argv[1]
exe = fluid.Executor(fluid.CPUPlace())
inference_program, feed_target_names, fetch_targets = fluid.io.load_inference_model(dirname=path, executor=exe)
feed_dict = {x: inference_program.global_block().var(x) for x in feed_target_names}
fetch_dict = {x.name : x for x in fetch_targets}
serving_io.save_model('model_server', 'model_client', feed_dict, fetch_dict, inference_program)

将以上的程序执行python trans_model.py $YOUR_MODEL_DIR 就可以看到有 model_servermodel_client两个文件。这样就可以用于上线了。

python -m paddle_serving_server.serve --model model_server --port 9292

@wyc880622
Copy link
Author

谢谢,我刚才看了paddlehub 不知道能否发布paddle的模型和paddledetection的模型。如果可以是不是比docker这个简单,因为我感觉docker还需要在装环境,有些麻烦了。
或者用C++ 的调用模型。我想知道飞浆的模型,发布后那种方式部署最快,最容易部署。我发现飞浆模型部署方式太多了。请给推荐个。谢谢

@guru4elephant
Copy link
Member

好的,感谢反馈,我们考虑进一步提高server端部署易用性

@paddle-bot paddle-bot bot closed this as completed Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants