Improve State and Engine docs
See original GitHub issueš Feature
Currently, if we execute twice trainer.run
we can fall into the following situation:
# ...
trainer.run(train_loader, max_epochs=5)
# reset model weights etc and rerun
trainer.run(train_loader, max_epochs=2)
> ValueError: Argument max_epochs should be larger than the start epoch defined in the state: 2 vs 5
But if we would like to restart the training from the begining, we have to reset trainer.state
as
trainer.run(train_loader, max_epochs=5)
# reset model weights etc and rerun
trainer.state.max_epochs = None
trainer.run(train_loader, max_epochs=2)
Letās improve two things:
- letās provide
State.restart()
method that just setsstate.max_epochs = None
- Add a note into
Engine.run
docstring saying if we would like to restart the training from zero, we have to either calltrainer.state.restart()
ortrainer.state.max_epochs = None
. - Improve the message āValueError: Argument max_epochs should be larger than the start epoch defined in the state: 2 vs 5ā by adding something like āPlease, call state.restart() before calling engine.run() if would like to restart from zero.ā
For Hacktoberfest contributors, feel free to ask questions for details if any and say that you would like to tackle the issue. Please, take a look at CONTRIBUTING guide.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:12 (8 by maintainers)
Top Results From Across the Web
Improve Performance | Compute Engine Documentation
This document covers some techniques you can use to improve the performance of your application. In some cases, examples from other APIs or...
Read more >SEO Starter Guide: The Basics | Google Search Central
A knowledge of basic SEO can have a noticeable impact. Explore the Google SEO starter guide for an overview of search engine optimization...
Read more >How to improve your local ranking on Google
To improve your business's local ranking, use Google Business Profile to claim and update your business ... Update your business info for better...
Read more >Ranking Results ā How Google Search Works
This site uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn moreOK, Got itĀ ...
Read more >Unreal Engine 5.1 Release Notes
More information can be found in the Nanite documentation. Improved support for hybrid Nanite / non-Nanite workflows for the purpose of authoring for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just a remark, having a
restart()
method lets user call it when he wants, even if itās not the good time. Why do not have such feature in the trainer ? No way to misuse it. What do you think ? @vfdev-5 @fco-dvIām not fan of introducing new arg like
restart
ā¦