Skip to content

【PPSCI Export&Infer No.8】Add export and inference for amgnet_cylinder #1165

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

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

Hydralune
Copy link

@Hydralune Hydralune commented Jun 12, 2025

PR types

New features

PR changes

APIs, Docs

Describe

This PR enhances the amgnet_cylinder example by adding model export and Python inference functionalities, aligning it with deployment standards for practical applications.

The main changes include:

  1. examples/amgnet/amgnet_cylinder.py:

    • Implemented an export() function to save the trained model in a static graph format for inference.
    • Implemented an inference() function to load the exported model and perform predictions.
    • Updated the main() function to orchestrate the new export and infer modes based on the configuration file.
  2. examples/amgnet/deploy/python_infer/amgn_predictor.py:

    • Introduced a new custom predictor class, AMGNPredictor.
    • This is necessary to handle the specific pgl.Graph input data type required by the AMGNet model, which is not supported by standard predictors.
  3. examples/amgnet/conf/amgnet_cylinder.yaml:

    • Added a new INFER section to centralize all configurations for the model export and inference processes.
  4. Documentation (docs/zh/examples/amgnet.md):

    • Consolidated the amgnet_cylinder documentation into the main amgnet.md file.
    • Deleted the standalone examples/amgnet/amgnet_cylinder.md file.
    • Added a new, detailed section with instructions and command examples for running model export and inference.

Copy link

paddle-bot bot commented Jun 12, 2025

Thanks for your contribution!

@CLAassistant
Copy link

CLAassistant commented Jun 12, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码看起来存在大量的末尾空格,还麻烦使用pre-commit格式化删除一下
image

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Jun 16, 2025
@HydrogenSulfate
Copy link
Collaborator

@Hydralune 请签署一下CLA
image

@luotao1
Copy link
Collaborator

luotao1 commented Jun 16, 2025

  1. 请签署CLA
  2. PR标题请遵循规范

@Hydralune Hydralune changed the title feat(amgnet): Add export and inference for amgnet_cylinder 【PPSCI Export&Infer No.8】 Add export and inference for amgnet_cylinder Jun 16, 2025
@Hydralune
Copy link
Author

已完成CLA签署,pre-commits代码检查,文档整合,标题修改。

Copy link
Collaborator

@luotao1 luotao1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这几个文件没有发生变化,请还原,不要修改

请参考 Code Review 注意事项,每个意见都需要回复。

@Hydralune
Copy link
Author

这几个文件没有发生变化,请还原,不要修改

请参考 Code Review 注意事项,每个意见都需要回复。
目前对未修改的文件也进行了还原,感谢您的审阅!

@HydrogenSulfate HydrogenSulfate changed the title 【PPSCI Export&Infer No.8】 Add export and inference for amgnet_cylinder 【PPSCI Export&Infer No.8】Add export and inference for amgnet_cylinder Jun 17, 2025
@HydrogenSulfate
Copy link
Collaborator

@Hydralune 这个代码确定能运行吗?
image

@Hydralune
Copy link
Author

审阅者您好,关于agment的问题,我会尽力解决。

@Hydralune
Copy link
Author

image
审阅者您好,实测导出与推理功能在本地可以运行,请您再次检查,如有问题我会继续修复。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants