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

Potential bug in DataLoader2 when seed = 0 #1097

Closed
NivekT opened this issue Mar 17, 2023 · 1 comment
Closed

Potential bug in DataLoader2 when seed = 0 #1097

NivekT opened this issue Mar 17, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@NivekT
Copy link
Contributor

NivekT commented Mar 17, 2023

🐛 Describe the bug

If you try to set the seed = 0 as such:

dp = IterableWrapper(range(20)).shuffle()
rs = MultiProcessingReadingService(num_workers=2)

dl = DataLoader2(datapipe=dp, reading_service=rs)
dl.seed(0)

The seed will not be set because this line returns False. I think the true intention is to skip over None, but 0 also gets skipped as it is currently implemented.

I suppose we can say seed = 0 is invalid but it is probably better to check for self._seed is not None instead.

Versions

main

@NivekT NivekT self-assigned this Mar 17, 2023
@NivekT NivekT added the bug Something isn't working label Mar 17, 2023
@NivekT
Copy link
Contributor Author

NivekT commented Mar 20, 2023

Fixed as #1098 has landed

@NivekT NivekT closed this as completed Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant