Skip to content
Snippets Groups Projects
Commit d22dece1 authored by Philip ABBET's avatar Philip ABBET
Browse files

[data/augmentations] Use the 'spawn' multiprocessing start method on all platforms

parent b5a49ca8
No related branches found
No related tags found
1 merge request!6Making use of LightningDataModule and simplification of data loading
Pipeline #83244 passed
......@@ -287,7 +287,7 @@ class ElasticDeformation:
logger.info(
f"Applying data-augmentation using {instances} processes..."
)
self._mp_pool = multiprocessing.pool.Pool(instances)
self._mp_pool = multiprocessing.get_context("spawn").Pool(instances)
else:
self._mp_pool = None
......@@ -296,7 +296,9 @@ class ElasticDeformation:
if self._mp_pool is None and self._parallel == -2:
# auto-tunning on first batch
instances = min(img.shape[0], multiprocessing.cpu_count())
self._mp_pool = multiprocessing.pool.Pool(instances)
self._mp_pool = multiprocessing.get_context("spawn").Pool(
instances
)
return _elastic_deformation_on_batch(
img,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment