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

handle multi-workers data loaders more gracefully #137

Closed
kaczmarj opened this issue Jul 7, 2023 · 1 comment · Fixed by #144
Closed

handle multi-workers data loaders more gracefully #137

kaczmarj opened this issue Jul 7, 2023 · 1 comment · Fixed by #144

Comments

@kaczmarj
Copy link
Member

kaczmarj commented Jul 7, 2023

in our current Dataset class, add a worker_init function that initializes the whole slide image object. then in the Dataloader instantiation, pass that function name.

see Bayer-Group/tiffslide#18 (comment) for an example.

kaczmarj added a commit that referenced this issue Jul 10, 2023
Fixes #137

The OpenSlide object is no longer created in `__init__`. Previously the
openslide object was shared across workers. Now each worker creates its
own OpenSlide object. I hypothesize that this will allow multi-worker
data loading on Windows.
@kaczmarj
Copy link
Member Author

one issue with this implementation is that an exception is raised when num_workers=0. i assume worker_init is not being called in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant