ultralytics icon indicating copy to clipboard operation
ultralytics copied to clipboard

Enhance argument loading when resuming. Fixes #6553

Open R-N opened this issue 1 year ago • 3 comments

Issue #6553, resume=True doesn't actually enforce caching. It was caused by resuming a model that was trained with caching. This PR allows overriding cache and epochs. It also removes and renames loaded arguments that are now deprecated.

🤖[deprecated] Generated by Copilot at dd72f57

Summary

🔄🗑️🐛

Fix check_resume function in trainer.py to handle outdated arguments in checkpoint files. This improves compatibility and error handling when resuming training.

check_resume adapts to old or renamed args fall leaves change their hues

Walkthrough

  • Update check_resume function to handle obsolete, renamed, or negated arguments in checkpoint file (link)

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

📊 Key Changes

  • Added an exclude_class option in plot to ignore specific classes when plotting results.
  • Updated argument handling in check_resume to clean up obsolete arguments and accommodate renamed or negated arguments.

🎯 Purpose & Impact

  • The exclude_class option helps users to focus on relevant detection classes by excluding unwanted ones, enhancing the clarity of visual results. 🎨
  • Improved argument management when resuming training ensures compatibility and reduces memory usage to prevent CUDA Out Of Memory (OOM) crashes. This increases the robustness of model training. 🛠️

🌟 Summary

Now you can exclude certain classes from your detection plots, and resuming model training is smoother and less prone to memory issues! 🚀

R-N avatar Dec 07 '23 18:12 R-N

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

github-actions[bot] avatar Dec 07 '23 18:12 github-actions[bot]

Codecov Report

Attention: Patch coverage is 57.14286% with 6 lines in your changes missing coverage. Please review.

Project coverage is 79.90%. Comparing base (bc5b528) to head (90b88d1). Report is 856 commits behind head on main.

Files with missing lines Patch % Lines
ultralytics/engine/trainer.py 58.33% 5 Missing :warning:
ultralytics/engine/results.py 50.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6854      +/-   ##
==========================================
- Coverage   82.24%   79.90%   -2.34%     
==========================================
  Files         106      106              
  Lines       13023    13036      +13     
==========================================
- Hits        10711    10417     -294     
- Misses       2312     2619     +307     
Flag Coverage Δ
Benchmarks 37.75% <0.00%> (-0.04%) :arrow_down:
GPU 41.46% <0.00%> (-0.05%) :arrow_down:
Tests 74.62% <57.14%> (-2.94%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Dec 07 '23 18:12 codecov[bot]

@R-N you have to comment this "I have read the CLA Document and I sign the CLA"

Kayzwer avatar Dec 08 '23 01:12 Kayzwer