Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix infinite recursion risk in ImageDataset error handling#2508

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mohiuddin-khan-shiam wants to merge2 commits intohuggingface:main
base:main
Choose a base branch
Loading
frommohiuddin-khan-shiam:main

Conversation

mohiuddin-khan-shiam

Fix infinite recursion risk in ImageDataset error handling

Changes

  • Added maximum retry limit to prevent infinite recursion when loading corrupted/missing files
  • Improved error messages and logging for better diagnostics
  • Separated file access errors from image loading errors
  • Enhanced error recovery with proper state management

Impact

  • More reliable dataset loading
  • Better error diagnostics
  • Prevents potential infinite recursion edge cases
  • Maintains backward compatibility

Enhanced the error handling in ImageDataset.__getitem__ to prevent potential infinite recursion when loading corrupted or missing image files. The changes include:Added a maximum retry limit based on dataset sizeImproved error messages and loggingBetter separation of file access and image loading errorsMore robust error recovery with proper state managementThis makes the dataset loading more reliable and provides better diagnostics when issues occur.
### Changes- Added proper cleanup of tarfile objects to prevent file descriptor leaks- Improved error handling with more descriptive messages- Added worker safety for multi-process DataLoader scenarios- Enhanced file handling to read and close files immediately### Impact- Prevents resource leaks during training with tar-based datasets- Makes error messages more actionable- Improves stability in multi-worker data loading- Maintains backward compatibility while being more robust
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@mohiuddin-khan-shiam

[8]ページ先頭

©2009-2025 Movatter.jp