binli123 / dsmil-wsi

DSMIL: Dual-stream multiple instance learning networks for tumor detection in Whole Slide Image
MIT License
332 stars 84 forks source link

deepzoom_tiler freezes #80

Closed jafarinia closed 7 months ago

jafarinia commented 1 year ago

The code deepzoom_tiler.py sometimes freezes at the end of patching a slide (seems like the JoinableQueue does not get empty and self._queue.join() does not allow the code to continue executing). Have you experienced it and it is normal? Are the saved patches reliable or somehow this process communication problem makes everything unreliable and mixed up? (for example having patches of one slide in the folder of another slide)

HaoyuCui commented 9 months ago

Hi, there! I think the problem should occur here:

def _shutdown(self):
   for _i in range(self._workers):
       self._queue.put(None)
   self._queue.join()

If you set the workers to 0, the loop would stop as there is no worker. Changing the --workers back to 4 or other non-zero values will solve the problem. PS: the change will not raise any error on Windows