From 7ac7e1078b0e7b37906f7bbacabd7345a57f5e7a Mon Sep 17 00:00:00 2001 From: arve0 Date: Sat, 16 May 2015 12:07:11 +0200 Subject: [PATCH] cpu_count may raise NotImplementedError --- skimage/util/apply.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/skimage/util/apply.py b/skimage/util/apply.py index 495be032..a63be1c1 100644 --- a/skimage/util/apply.py +++ b/skimage/util/apply.py @@ -80,7 +80,10 @@ def apply_chunks(function, array, chunks=None, depth=0, mode=None, """ if chunks is None: shape = array.shape - ncpu = cpu_count() + try: + ncpu = cpu_count() + except NotImplementedError: + ncpu = 4 chunks = _get_chunks(shape, ncpu) if mode == 'wrap':