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

Fix bug with resume #8912

Merged
merged 4 commits into from
Aug 16, 2022
Merged

Fix bug with resume #8912

merged 4 commits into from
Aug 16, 2022

Conversation

savchenkoyana
Copy link
Contributor

@savchenkoyana savchenkoyana commented Aug 9, 2022

Hello, I noticed strange code behavior.

I ran training on coco128:

python train.py --name exp_coco128

trained for 2 epochs and then stopped.

Then ran:

python train.py --weights runs/train/exp_coco128/weights/last.pt

And the training continued from the 3rd epoch, although I didn't use --resume flag.
What's the point of --resume command if I resume my previous training without using it anyways?

I suggest calling smart_resume function only if resume == True. What do you think?

Thank you!

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Improvement in handling resume training logic in YOLOv5.

πŸ“Š Key Changes

  • Modified the train.py script, particularly the resume training functionality.
  • Added a conditional check to ensure smart_resume is called only when resume flag is true.

🎯 Purpose & Impact

  • 🎯 Purpose: To make the training resume process more robust and error-free by checking the resume flag before attempting to load previous training states.
  • πŸ’‘ Impact: Users will experience smoother resumption of interrupted training sessions, leading to more efficient experimentation and model development. This change prevents unnecessary attempts to resume from a checkpoint when the user has not explicitly requested it, thus safeguarding against potential issues or confusion.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘‹ Hello @savchenkoyana, thank you for submitting a YOLOv5 πŸš€ PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • βœ… Verify your PR is up-to-date with upstream/master. If your PR is behind upstream/master an automatic GitHub Actions merge may be attempted by writing /rebase in a new comment, or by running the following code, replacing 'feature' with the name of your local branch:
git remote add upstream https://github.com/ultralytics/yolov5.git
git fetch upstream
# git checkout feature  # <--- replace 'feature' with local branch name
git merge upstream/master
git push -u origin -f
  • βœ… Verify all Continuous Integration (CI) checks are passing.
  • βœ… Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." -Bruce Lee

@glenn-jocher glenn-jocher merged commit fd004f5 into ultralytics:master Aug 16, 2022
@glenn-jocher
Copy link
Member

@savchenkoyana PR is merged. Thank you for your contributions to YOLOv5 πŸš€ and Vision AI ⭐

ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
* Fix bug with resume

* restore del on resume=false

* Update train.py

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
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

Successfully merging this pull request may close these issues.

None yet

2 participants