SBU-BMI / wsinfer

🔥 🚀 Blazingly fast pipeline for patch-based classification in whole slide images
https://wsinfer.readthedocs.io
Apache License 2.0
56 stars 9 forks source link

handle multi-workers data loaders more gracefully #137

Closed kaczmarj closed 1 year ago

kaczmarj commented 1 year ago

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 https://github.com/bayer-science-for-a-better-life/tiffslide/issues/18#issuecomment-1047831961 for an example.

kaczmarj commented 1 year ago

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.