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

关于模型部署的问题: paddle serving error #9235

Open
2 of 3 tasks
fatsheep2020 opened this issue Dec 8, 2024 · 13 comments
Open
2 of 3 tasks

关于模型部署的问题: paddle serving error #9235

fatsheep2020 opened this issue Dec 8, 2024 · 13 comments
Assignees

Comments

@fatsheep2020
Copy link

问题确认 Search before asking

  • 我已经查询历史issue,没有发现相似的bug。I have searched the issues and found no similar bug report.

Bug组件 Bug Component

Deploy

Bug描述 Describe the Bug

按照 ~/deploy/README.md 中的指导导出paddleserving格式的模型:
python tools/export_model.py -c configs/yolov3/yolov3_mobilenet_v1_roadsign.yml -o weights=output/yolov3_mobilenet_v1_roadsign/best_model.pdparams --export_serving_model=True
会报错:
Traceback (most recent call last):
File "tools/export_model.py", line 118, in
main()
File "tools/export_model.py", line 114, in main
run(FLAGS, cfg)
File "tools/export_model.py", line 84, in run
from paddle_serving_client.io import inference_model_to_serving
File "/home/wade/.local/share/virtualenvs/3.paddle-l301jT_O/lib/python3.8/site-packages/paddle_serving_client/io/init.py", line 16, in
from paddle.fluid import Executor
ModuleNotFoundError: No module named 'paddle.fluid'

请问:现在云端部署还是用paddle-serving吗?还是用其他方法?
最近在做这方面的一个项目,打算用paddle做云端部署,还不知道改怎么弄,哪里有相关的文档?
比较着急,谢谢!

复现环境 Environment

ubuntu 20
paddle: 2.6.2
运行上述命令

Bug描述确认 Bug description confirmation

  • 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.

是否愿意提交PR? Are you willing to submit a PR?

  • 我愿意提交PR!I'd like to help by submitting a PR!
@fatsheep2020 fatsheep2020 changed the title 关于模型部署的问题 关于模型部署的问题: paddle serving Dec 8, 2024
@fatsheep2020 fatsheep2020 changed the title 关于模型部署的问题: paddle serving 关于模型部署的问题: paddle serving error Dec 8, 2024
@liuhongen1234567
Copy link
Collaborator

liuhongen1234567 commented Dec 8, 2024

您好,paddle的fluid 应该是比较老的paddle版本中采用的算子,可以尝试一些2.x的paddle版本。最新的部署方式建议您看一下 PaddleX文档的 3. 开发集成/部署部分。这个paddleX 中 paddle detection模型的文档 https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/pipeline_usage/tutorials/cv_pipelines/object_detection.md

@fatsheep2020
Copy link
Author

您好! 我尝试回退paddle到 2.4.0下面, 再次运行上面的export_model.py 命令,发现还是报错:
xxx-OMEN:~/1.project/1.YOLO/3.paddle/PaddleDetection$ python export_model_test.py -c configs/yolov3/yolov3_darknet53_270e_coco.yml --export_serving_model True -o weights=https://paddledet.bj.bcebos.com/models/yolov3_darknet53_270e_coco.pdparams
/home/xxx/.local/share/virtualenvs/3.paddle-l301jT_O/lib/python3.8/site-packages/setuptools/command/easy_install.py:41: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
/home/xxx/.local/share/virtualenvs/3.paddle-l301jT_O/lib/python3.8/site-packages/pkg_resources/init.py:3154: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('mpl_toolkits').
Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
/home/xxx/.local/share/virtualenvs/3.paddle-l301jT_O/lib/python3.8/site-packages/pkg_resources/init.py:3154: DeprecationWarning: Deprecated call to pkg_resources.declare_namespace('google').
Implementing implicit namespace packages (as specified in PEP 420) is preferred to pkg_resources.declare_namespace. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
declare_namespace(pkg)
Traceback (most recent call last):
File "export_model_test.py", line 31, in
from ppdet.core.workspace import load_config, merge_config
File "/home/wade/1.project/1.YOLO/3.paddle/PaddleDetection/ppdet/init.py", line 15, in
from . import (core, data, engine, modeling, model_zoo, optimizer, metrics,
File "/home/wade/1.project/1.YOLO/3.paddle/PaddleDetection/ppdet/data/init.py", line 16, in
from . import transform
File "/home/wade/1.project/1.YOLO/3.paddle/PaddleDetection/ppdet/data/transform/init.py", line 15, in
from . import operators
File "/home/wade/1.project/1.YOLO/3.paddle/PaddleDetection/ppdet/data/transform/operators.py", line 57, in
from ppdet.modeling.keypoint_utils import get_affine_transform, affine_transform
File "/home/wade/1.project/1.YOLO/3.paddle/PaddleDetection/ppdet/modeling/init.py", line 23, in
from . import heads
File "/home/wade/1.project/1.YOLO/3.paddle/PaddleDetection/ppdet/modeling/heads/init.py", line 17, in
from . import yolo_head
File "/home/wade/1.project/1.YOLO/3.paddle/PaddleDetection/ppdet/modeling/heads/yolo_head.py", line 26, in
from ..losses import IouLoss
File "/home/wade/1.project/1.YOLO/3.paddle/PaddleDetection/ppdet/modeling/losses/init.py", line 34, in
from . import clrnet_loss
File "/home/wade/1.project/1.YOLO/3.paddle/PaddleDetection/ppdet/modeling/losses/clrnet_loss.py", line 6, in
from ppdet.modeling.assigners.clrnet_assigner import assign
File "/home/wade/1.project/1.YOLO/3.paddle/PaddleDetection/ppdet/modeling/assigners/init.py", line 18, in
from . import simota_assigner
File "/home/wade/1.project/1.YOLO/3.paddle/PaddleDetection/ppdet/modeling/assigners/simota_assigner.py", line 22, in
from ppdet.modeling.losses.varifocal_loss import varifocal_loss
File "/home/wade/1.project/1.YOLO/3.paddle/PaddleDetection/ppdet/modeling/losses/varifocal_loss.py", line 27, in
from paddle.base.framework import in_dygraph_mode
ModuleNotFoundError: No module named 'paddle.base'

@fatsheep2020
Copy link
Author

上面的错误不知道是不是安装环境的问题? 还是export_model.py脚本的问题?

Paddle X的部署我学习一下,然后再告诉你结果。

@fatsheep2020
Copy link
Author

fatsheep2020 commented Dec 11, 2024

2024-12-11_102730
关于paddleX,我在飞桨的AI Studio 环境下安装好了paddle和paddlex但是运行paddlex还是会出错,是什么原因?

谢谢!
@liuhongen1234567
按照说明,启动paddlex服务,要用这个命令

@liuhongen1234567
Copy link
Collaborator

liuhongen1234567 commented Dec 11, 2024

!pip install --user paddlex==3.0.0b2,然后AI studio 重启一下内核呢?

@fatsheep2020
Copy link
Author

!pip install --user paddlex==3.0.0b2,然后AI studio 重启一下内核呢?

还是一样报错,重启了两次, 你那边可以试一下,这个命令不麻烦,安装也快. Paddle version 3.0.0-beta2

@fatsheep2020
Copy link
Author

paddle 版本在2.4下面是不是paddle serving也报错? paddle serving是不是不建议使用了?
@liuhonggen1234567

@fatsheep2020
Copy link
Author

您好,paddle的fluid 应该是比较老的paddle版本中采用的算子,可以尝试一些2.x的paddle版本。最新的部署方式建议您看一下 PaddleX文档的 3. 开发集成/部署部分。这个paddleX 中 paddle detection模型的文档 https://github.com/PaddlePaddle/PaddleX/blob/develop/docs/pipeline_usage/tutorials/cv_pipelines/object_detection.md

关于paddleX上的部署,上面这个文档我看完了,似懂非懂,飞桨有没有一个典型例子能够实际演练一下,切身体会怎么做?
我没有明白的点是哪些是在服务端(云端)要做的事情,云端要不要提前申请资源?申请什么样的资源(先不说费用) 哪些是在客户端要做的,客户端和服务端的交互是怎样的?
@liuhongen1234567 这是我主要的问题,回到不了上面的问题,我们企业内部没法评估,谢谢!

@liuhongen1234567
Copy link
Collaborator

您好,paddlex 基本每1到2周都有直播课,包含了训练、推理、部署全流程,可以点击这个地方报名 参与打卡营,打卡营会免费发放算力来体验,也会有专门负责部署的老师答疑;
image

@liuhongen1234567
Copy link
Collaborator

这个是PaddleX主页链接 https://github.com/PaddlePaddle/PaddleX?tab=readme-ov-file

@fatsheep2020
Copy link
Author

您好,paddlex 基本每1到2周都有直播课,包含了训练、推理、部署全流程,可以点击这个地方报名 参与打卡营,打卡营会免费发放算力来体验,也会有专门负责部署的老师答疑; image

好的,谢谢提供信息,有没有比较详细的文档或者完整的例子?

@liuhongen1234567
Copy link
Collaborator

可以进群了解一下吧,参与一次打卡营应该就对流程比较清楚了,我不是搞部署方面的,

@fatsheep2020
Copy link
Author

可以进群了解一下吧,参与一次打卡营应该就对流程比较清楚了,我不是搞部署方面的,

好的,谢谢!

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

3 participants