question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

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:

  1. letā€™s provide State.restart() method that just sets state.max_epochs = None
  2. Add a note into Engine.run docstring saying if we would like to restart the training from zero, we have to either call trainer.state.restart() or trainer.state.max_epochs = None.
  3. 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
sdesroziscommented, Sep 29, 2020

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-dv

1reaction
vfdev-5commented, Sep 29, 2020

Iā€™m not fan of introducing new arg like restart ā€¦

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found