potential multiprocessing fix for macos
Browse files
livermask/utils/process.py
CHANGED
@@ -39,6 +39,7 @@ def intensity_normalization(volume, intensity_clipping_range):
|
|
39 |
|
40 |
def liver_segmenter_wrapper(curr, output, cpu, verbose, multiple_flag, name):
|
41 |
# run inference in a different process
|
|
|
42 |
with mp.Pool(processes=1, maxtasksperchild=1) as p: # , initializer=initializer)
|
43 |
result = p.map_async(liver_segmenter, ((curr, output, cpu, verbose, multiple_flag, name), ))
|
44 |
log.info("getting result from process...")
|
|
|
39 |
|
40 |
def liver_segmenter_wrapper(curr, output, cpu, verbose, multiple_flag, name):
|
41 |
# run inference in a different process
|
42 |
+
mp.set_start_method('spawn')
|
43 |
with mp.Pool(processes=1, maxtasksperchild=1) as p: # , initializer=initializer)
|
44 |
result = p.map_async(liver_segmenter, ((curr, output, cpu, verbose, multiple_flag, name), ))
|
45 |
log.info("getting result from process...")
|