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

[BUG] Issue with multi-threading when using blur filtering #375

Open
tnnandi opened this issue May 28, 2024 · 0 comments
Open

[BUG] Issue with multi-threading when using blur filtering #375

tnnandi opened this issue May 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tnnandi
Copy link

tnnandi commented May 28, 2024

Description

To Reproduce

Steps to reproduce the behavior:

  1. Choose 'blur' for qc in the tile extraction step:
dataset.extract_tiles(qc='blur', #  ‘otsu’, ‘blur’, ‘both’, or None  # qc.GaussianV2()
                      save_tiles=True,
                      save_tfrecords=True,
                      skip_extracted=False,
                      max_tiles = 200,)
           INFO     Extracting tiles from 34 slides (tile_px=256, tile_um=9.9x)
           INFO     Using 64 processes (pool=fork)
           INFO     No ROI for TCGA-86-6562-01Z-00-DX1.5dea3015-e606-4837-9f99-ac14f0aa091b, using whole slide.
Speed:  ?
Extracting... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   0%  0/34 ● -:--:--[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 50: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 51: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 51: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 52: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 52: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 53: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 53: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 54: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 54: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 55: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 55: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 56: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 56: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 57: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 57: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 58: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 58: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 59: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 59: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 60: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 60: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 61: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 61: Can't spawn new thread: res = 11
[ERROR:[email protected]] global parallel_impl.cpp:244 WorkerThread 62: Can't spawn new thread: res = 11
[07:31:39] INFO     Finished tile extraction for TCGA-86-6562 (200 tiles of 2953 possible)
           INFO     No ROI for TCGA-86-7711-01Z-00-DX1.f64dd9d8-b9ca-4d1f-9783-d1042979132d, using whole slide.
Speed:  571 img/s
Extracting... ━╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   3%  1/34 ● -:--:--
Traceback (most recent call last):
  File "/lus/eagle/clone/g2/projects/GeomicVar/tarak/multimodal_learning_T1/preprocessing/slideflow_preprocessing.py", line 45, in <module>
    dataset.extract_tiles(qc='blur', #  ‘otsu’, ‘blur’, ‘both’, or None  # qc.GaussianV2()
  File "/lus/eagle/clone/g2/projects/GeomicVar/tarak/multimodal_learning_T1/slideflow/slideflow/slideflow_scratch_env/lib/python3.9/site-packages/slideflow/dataset.py", line 1762, in extract_tiles
    wsi = _prepare_slide(
  File "/lus/eagle/clone/g2/projects/GeomicVar/tarak/multimodal_learning_T1/slideflow/slideflow/slideflow_scratch_env/lib/python3.9/site-packages/slideflow/dataset.py", line 140, in _prepare_slide
    slide.qc(method=qc, **qc_kwargs)
  File "/lus/eagle/clone/g2/projects/GeomicVar/tarak/multimodal_learning_T1/slideflow/slideflow/slideflow_scratch_env/lib/python3.9/site-packages/slideflow/slide/wsi.py", line 2552, in qc
    mask = qc(self)
  File "/lus/eagle/clone/g2/projects/GeomicVar/tarak/multimodal_learning_T1/slideflow/slideflow/slideflow_scratch_env/lib/python3.9/site-packages/slideflow/slide/qc/gaussian_v2.py", line 125, in __call__
    blur_mask = super().__call__(wsi)
  File "/lus/eagle/clone/g2/projects/GeomicVar/tarak/multimodal_learning_T1/slideflow/slideflow/slideflow_scratch_env/lib/python3.9/site-packages/slideflow/slide/qc/strided_qc.py", line 379, in __call__
    if self.filter_pool is not None:
  File "/lus/eagle/clone/g2/projects/GeomicVar/tarak/multimodal_learning_T1/slideflow/slideflow/slideflow_scratch_env/lib/python3.9/site-packages/slideflow/slide/qc/strided_qc.py", line 255, in filter_pool
    self._filter_pool = mp.dummy.Pool(self.filter_threads)
  File "/lus/eagle/clone/g2/projects/GeomicVar/tarak/multimodal_learning_T1/slideflow/slideflow/slideflow_scratch_env/lib/python3.9/multiprocessing/dummy/__init__.py", line 124, in Pool
    return ThreadPool(processes, initializer, initargs)
  File "/lus/eagle/clone/g2/projects/GeomicVar/tarak/multimodal_learning_T1/slideflow/slideflow/slideflow_scratch_env/lib/python3.9/multiprocessing/pool.py", line 927, in __init__
    Pool.__init__(self, processes, initializer, initargs)
  File "/lus/eagle/clone/g2/projects/GeomicVar/tarak/multimodal_learning_T1/slideflow/slideflow/slideflow_scratch_env/lib/python3.9/multiprocessing/pool.py", line 250, in __init__
    self._result_handler.start()
  File "/lus/eagle/clone/g2/projects/GeomicVar/tarak/multimodal_learning_T1/slideflow/slideflow/slideflow_scratch_env/lib/python3.9/threading.py", line 899, in start
    _start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/lus/eagle/clone/g2/projects/GeomicVar/tarak/multimodal_learning_T1/slideflow/slideflow/slideflow_scratch_env/lib/python3.9/threading.py", line 980, in _bootstrap_inner
    self.run()
  File "/lus/eagle/clone/g2/projects/GeomicVar/tarak/multimodal_learning_T1/slideflow/slideflow/slideflow_scratch_env/lib/python3.9/threading.py", line 917, in run
    self._target(*self._args, **self._kwargs)
  File "/lus/eagle/clone/g2/projects/GeomicVar/tarak/multimodal_learning_T1/slideflow/slideflow/slideflow_scratch_env/lib/python3.9/multiprocessing/managers.py", line 194, in accepter
    t.start()
  File "/lus/eagle/clone/g2/projects/GeomicVar/tarak/multimodal_learning_T1/slideflow/slideflow/slideflow_scratch_env/lib/python3.9/threading.py", line 899, in start
    _start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread

Expected behavior

Environment:

  • Slideflow Version (e.g., 1.0): 2.3.1
  • OS (e.g., Ubuntu):
  • How you installed Slideflow (pip, source): Tried using both 'pip install' and install from source
  • Python version: 3.9
  • CUDA/cuDNN version: 12.1
  • GPU models and configuration: A100
  • Any other relevant information:

Additional context

The issue doesn't arise when 'blur' isn't used (e.g., qc='otsu')

@tnnandi tnnandi added the bug Something isn't working label May 28, 2024
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