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

如何保留最优的模型 #202

Open
peach-xiao opened this issue May 8, 2022 · 0 comments
Open

如何保留最优的模型 #202

peach-xiao opened this issue May 8, 2022 · 0 comments

Comments

@peach-xiao
Copy link

您好!在使用PaddleVIT用于语义分割的过程中,我遇到了问题,希望可以得到您的帮助:

我研究了train.py在训练过程中保存的部分代码,采用的策略是根据训练的 Iter 次数(如:2000次保存一次模型),然后根据配置保留最新的10个模型,我有一个疑问,在训练过程中模型其实很有可能就已经达到最优了,再继续训练会导致过拟合的问题。也就是说其实最后保留的10个模型里面,很有可能在验证集上的结果不是最优的甚至更差,这样并不能在验证集反映一个模型的好坏。

采用这样的策略:在训练集上训练一次,然后在验证集上验证一次,若比之前的效果好,就更新最好的模型,训练完成后也就保留在验证集上评价指标最好的模型,这样的话是不是会更好?

但是我发现,不管是一些框架,或是一些顶级期刊论文中提供的代码,他们采用的训练方案和你们一样的保留模型的方法,如:迭代次数160k,然后训练完成后用最后的模型进行验证(但是我认为最后的模型可能不是最好的)。希望可以得到相应的解释,非常感谢!

image

@peach-xiao peach-xiao changed the title 模型保存问题 如何保留最优的模型 May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants