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

如何设置参数使得保存模型最优权重的问题? #54

Open
wangwangwang978 opened this issue Dec 26, 2023 · 1 comment
Open

Comments

@wangwangwang978
Copy link

No description provided.

@WwZzz
Copy link
Owner

WwZzz commented Feb 3, 2024

你好,默认不提供通过设置参数来保存模型。如需保存模型,建议继承类flgo.experiment.logger.BasicLogger并重写log_once函数,它每隔数轮(eval_interval)会被执行一次 ,用于评估当前模型,这里头也适用于写模型参数的保存部分,例如:
`class MyLogger(BasicLogger):
def log_once(self):
# 保存模型
...
torch.save(self.server.model, save_path)
...

flgo.init(...,Logger=MyLogger, ...)
`

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