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

classify/train.py script should accept patience parameter #11491

Closed
2 tasks done
sohang3112 opened this issue May 5, 2023 · 5 comments
Closed
2 tasks done

classify/train.py script should accept patience parameter #11491

sohang3112 opened this issue May 5, 2023 · 5 comments
Labels
enhancement New feature or request Stale

Comments

@sohang3112
Copy link

Search before asking

  • I have searched the YOLOv5 issues and found no similar feature requests.

Description

This Stack Overflow answer gives a good explanation of what patience is

Suppose a model is being trained for 100 epochs. But after epoch 60, the model's accuracy & loss don't improve any more.
If 5 more epochs pass and the model's accuracy & loss still don't improve, then the training loop should stop running.

In this example, the best epoch is 60, and patience is 5 epochs (number of epochs for which training loop should continue running when accuracy & loss stop improving).

Use case

This would save time during model training, as the training loop will not keep running for no reason even when model's loss is not decreasing (or even increasing!)

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@sohang3112 sohang3112 added the enhancement New feature or request label May 5, 2023
@glenn-jocher
Copy link
Member

@sohang3112 thank you for suggesting this feature, it could definitely be a useful addition to YOLOv5. We appreciate your willingness to contribute to the project by submitting a PR. Our team will review and consider your idea for implementation in future updates.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2023

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

@github-actions github-actions bot added the Stale label Jun 5, 2023
@sohang3112
Copy link
Author

Unlike classify/train.py, train.py has implemented patience using utils.torch_utils.EarlyStopping class. Will try to use this approach for implementing in classify/train.py also. A slight modification in EarlyStopping class would also be needed - its logging message would have to print classify/train.py instead of train.py.

@glenn-jocher
Copy link
Member

@sohang3112 thank you for the suggestion, we appreciate your input. It's great to hear that patience has already been implemented in the train.py script using the utils.torch_utils.EarlyStopping class. We will certainly consider your idea for implementing patience in classify/train.py using a similar approach and modifying the logging message to print the correct script name. Your contribution to the YOLOv5 community is valuable, and we thank you for your help to improve the project.

@github-actions github-actions bot removed the Stale label Jun 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 6, 2023

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

@github-actions github-actions bot added the Stale label Jul 6, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale
Projects
None yet
Development

No branches or pull requests

2 participants