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

请问通过pipeline聚合后的模型如何获得权重? #5695

Open
lidefan888 opened this issue Aug 6, 2024 · 4 comments
Open

请问通过pipeline聚合后的模型如何获得权重? #5695

lidefan888 opened this issue Aug 6, 2024 · 4 comments

Comments

@lidefan888
Copy link

FATE版本为1.11.3,
目前只找到 pipeline.dump 来保存pipeline,但是如何获得聚合后的模型权重,以便脱离联邦学习去使用

@mgqa34
Copy link
Contributor

mgqa34 commented Aug 8, 2024

具体运行参数是怎样的?如果参数没有设置保存为本地路径,可以通过flow的output-model接口去下载模型(https://federatedai.github.io/FATE-Flow/1.11.2/fate_flow_client/#output-model),如果设置为保存本地路径,那就是在设置的路径下

@lidefan888
Copy link
Author

感谢您的回复,我使用output-model接口去下载模型了,得到的结果和fateflow/model_local_cache/host#10000#arbiter-10000#guest-9999#host-10000#model/202408090109205279510/variables/data/nn_0/model/HomoNNParam.json一样。
并且其中的modelBytes和extraDataBytes都是乱码。
部分内容如下:
"extraDataBytes": "UEsDBAAACAgAAAAAAAAAAAAAAAAAAAAAAAAQABIAYXJjaGl2ZS9kYXRhLnBrbEZCDgBaWlpaWlpaWlpaWlpaWoACfXEALlBLBwjykQLFBgAAAAYAAABQSwMEAAAICAAAAAAAAAAAAAAAAAAAAAAAAA8APQBhcmNoaXZlL3ZlcnNpb25GQjkAWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaMwpQSwcI0Z5nVQIAAAACAAAAUEsBAgAAAAAICAAAAAAAAPKRAsUGAAAABgAAABAAAAAAAAAAAAAAAAAAAAAAAGFyY2hpdmUvZGF0YS5wa2xQSwECAAAAAAgIAAAAAAAA0Z5nVQIAAAACAAAADwAAAAAAAAAAAAAAAABWAAAAYXJjaGl2ZS92ZXJzaW9uUEsGBiwAAAAAAAAAHgMtAAAAAAAAAAAAAgAAAAAAAAACAAAAAAAAAHsAAAAAAAAA0gAAAAAAAABQSwYHAAAAAE0BAAAAAAAAAQAAAFBLBQYAAAAAAgACAHsAAADSAAAAAAA=", "epochIdx": 8, "lossHistory": [2.3029475, 2.2999647, 2.2992065, 2.2980556, 2.298894, 2.2977521, 2.2971725, 2.297455, 2.2973988], "bestEpoch": 6, "convergeStatus": false, "localSavePath": ""

@lidefan888
Copy link
Author

根据您提供的接口,添加了pipeline.model_convert.convert()这行代码,
确实保存了一个模型权重,但是与我最初导入的模型权重结构不一样,
而对这行代码的介绍是将 Homo 模型转换为其他机器学习系统的格式,
请问是转换成pytorch格式了么

@lidefan888
Copy link
Author

请问用DSL方式如何导出模型权重呢,flow的output-model接口还是乱码,该如何解码

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

2 participants