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

Make cache saving optional #2977

Merged
merged 1 commit into from
Apr 29, 2021
Merged

Make cache saving optional #2977

merged 1 commit into from
Apr 29, 2021

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Apr 29, 2021

Place dataset cache-saving ops into a try: except statement to catch non-writable directory failure mode in #2976.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Improved cache saving robustness for dataset labels in YOLOv5.

📊 Key Changes

  • Added a try-except block around the cache label saving logic.
  • Included exception handling for potential write errors.

🎯 Purpose & Impact

  • Ensures smoother user experience: The change helps prevent the program from crashing if it cannot save the label cache file, informing the user instead of failing silently.
  • Better error logging: If a cache cannot be written due to directory permissions, the user is alerted with a clear warning message.
  • Enhanced fault tolerance: The update makes the system more robust by handling exceptions during file operations, which can occur in restricted file system environments.

@glenn-jocher
Copy link
Member Author

Note that cache saving is merely useful for reducing subsequent time-to-train but has no effect on current training. On every training if a cache is not found then the dataset is scanned again, and a cache is saved for next time if the directory has write access.

@glenn-jocher glenn-jocher merged commit 955eea8 into master Apr 29, 2021
@glenn-jocher glenn-jocher deleted the glenn-jocher-patch-4 branch April 29, 2021 22:56
KMint1819 pushed a commit to KMint1819/yolov5 that referenced this pull request May 12, 2021
danny-schwartz7 pushed a commit to danny-schwartz7/yolov5 that referenced this pull request May 22, 2021
Lechtr pushed a commit to Lechtr/yolov5 that referenced this pull request Jul 20, 2021
BjarneKuehl pushed a commit to fhkiel-mlaip/yolov5 that referenced this pull request Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant