Skip to content

【PPSCI Export&Infer No.1】 Add export and inference for deephpms_schrodinger #1170

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 8 commits into
base: develop
Choose a base branch
from

Conversation

jiangandhao
Copy link

PR types

PR changes

Describe

Copy link

paddle-bot bot commented Jun 19, 2025

Thanks for your contribution!

@jiangandhao
Copy link
Author

eval

infer

跑通模型导出和推理的截图
导出
export_run
推理
infer_run
评估
eval_run

@jiangandhao
Copy link
Author

这样可以了吗?

@luotao1 luotao1 changed the title PPSCI Export&Infer No.1 Add export and inference for deephpms_schrodinger 【PPSCI Export&Infer No.1】 Add export and inference for deephpms_schrodinger Jun 20, 2025
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Jun 20, 2025
@luotao1 luotao1 self-assigned this Jun 20, 2025
@luotao1
Copy link
Collaborator

luotao1 commented Jun 20, 2025

@lxw123123 审核

@jiangandhao
Copy link
Author

jiangandhao commented Jun 20, 2025

@lxw123123 请求审核

@jiangandhao
Copy link
Author

@HydrogenSulfate 请求审核

Copy link
Author

@jiangandhao jiangandhao left a comment

Choose a reason for hiding this comment

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

基本完成了export和inference的开发,通过eval_schrodinger.py和infer_schrodinger.py导出本地自测结果(原代码文件名过长无法正常加载,使用新建文件方式跳过部分中间文件)

@@ -11,7 +11,7 @@ defaults:
hydra:
run:
# dynamic output directory according to running time and override name
dir: outputs_schrodinger/${now:%Y-%m-%d}/${now:%H-%M-%S}/${hydra.job.override_dirname}
dir: outputs_schrodinger/${now:%Y-%m-%d}/${now:%H-%M-%S}/schrodinger_output
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个不用改

Comment on lines 79 to 82
#export settings
EXPORT:
pretrained_model_path: ${output_dir}/checkpoints/latest
export_path: ${output_dir}/inference_model
Copy link
Collaborator

Choose a reason for hiding this comment

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

直接放INFER字段里即可,不需要单独添加EXPORT字段,跟其它案例保持一致

Copy link
Collaborator

Choose a reason for hiding this comment

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

你的PR是添加export&inference,为什么要再写一个evaluate呢?

Copy link
Collaborator

Choose a reason for hiding this comment

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

export&infernece功能请封装到函数加到原有案例文件中,不需要单独新建文件

mkdocs.yml Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

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

mkdocs.yml里有deephpms,不需要重复添加

@leeleolay
Copy link
Contributor

leeleolay commented Jun 20, 2025

image image 模型到处和推理我本地跑的时候有跑错,可以在linux环境下测试下嘛

@jiangandhao
Copy link
Author

image image 模型到处和推理我本地跑的时候有跑错,可以在linux环境下测试下嘛

在改了

@jiangandhao
Copy link
Author

image image 模型到处和推理我本地跑的时候有跑错,可以在linux环境下测试下嘛

在改了

windons下的并没有成功,有文件需要合并

@jiangandhao
Copy link
Author

85c7c7d1-7e01-4742-b54d-9731f5242597
587a9c4d-b8db-41ba-9910-0316e4c333ad
评估结果和推理结果相近

导出和推理图片:
c59ff72b-7f6e-444c-98ba-ab181d7b38cf
985fd18a-1f0d-4ded-9581-fcb929dd773c

在导出过程中,遇到了无法使用静态图导出的问题,slover一运行就中断,使用json.dump和paddle.save保存模型参数,然后基于此进行推理
@HydrogenSulfate 请指正

@jiangandhao
Copy link
Author

使用PaddleScience\docs\zh\examples\deephpms.md进行导出和推理
结果正确
mode=export
6c532ca0-d93b-43fc-abff-5a773c165162

mode=infer
baa76831-fa2c-4219-8667-fa856342374f

mode=eval
7e56f91a-df34-40b9-9dfa-832764b8dcf5

mode=eval的结果
0e1de197-b6a6-453c-bae7-44f4c2a228dc

mode=infer的结果
7d11b53e-787e-4692-b3bd-ffca0f84fea8

@jiangandhao
Copy link
Author

@HydrogenSulfate 这样笔试算过了吗

@jiangandhao
Copy link
Author

jiangandhao commented Jun 21, 2025 via email

@jiangandhao
Copy link
Author

@luotao1

Copy link
Contributor

Choose a reason for hiding this comment

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

这个文件不需要在提交代码中出现

@leeleolay
Copy link
Contributor

infer导出文件的路径有问题
image

@leeleolay
Copy link
Contributor

修改完小问题后,可以算作完成这个笔试题目

@jiangandhao
Copy link
Author

infer原本导出路径和eval的导出路径是类似的,都是类似examples\deephpms\outputs_schrodinger\2025-06-21\09-53-55\DATASET_PATH=\datasets\NLS.mat的,按照要求修改,改成了类似examples\deephpms\outputs_schrodinger\2025-06-21\09-53-55\的

Contributor

@jiangandhao jiangandhao requested a review from leeleolay June 21, 2025 08:12
@jiangandhao
Copy link
Author

修改完小问题后,可以算作完成这个笔试题目
您好,已经修改完毕了

@leeleolay
Copy link
Contributor

我这里检查没有问题

Copy link
Contributor

@leeleolay leeleolay left a comment

Choose a reason for hiding this comment

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

验证跑通

@luotao1
Copy link
Collaborator

luotao1 commented Jun 21, 2025

修改完小问题后,可以算作完成这个笔试题目

  1. 笔试题完成
  2. 本PR还需要等 @HydrogenSulfate 的意见,完成最终的合入,如有审核意见请配合修改,谢谢!

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