Closed sofroniewn closed 3 years ago
Note the bug also happens with np.asarray(embryo[0])
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
/var/folders/30/g_dcv_xs2l315nvmwq0_v52r0000gr/T/ipykernel_16513/3912845265.py in <module>
----> 1 np.asarray(embryo[0])
~/opt/anaconda3/envs/scipy2021-bioimage-analysis/lib/python3.8/site-packages/dask/array/core.py in __array__(self, dtype, **kwargs)
1506
1507 def __array__(self, dtype=None, **kwargs):
-> 1508 x = self.compute()
1509 if dtype and x.dtype != dtype:
1510 x = x.astype(dtype)
~/opt/anaconda3/envs/scipy2021-bioimage-analysis/lib/python3.8/site-packages/dask/base.py in compute(self, **kwargs)
284 dask.base.compute
285 """
--> 286 (result,) = compute(self, traverse=False, **kwargs)
287 return result
288
~/opt/anaconda3/envs/scipy2021-bioimage-analysis/lib/python3.8/site-packages/dask/base.py in compute(*args, **kwargs)
566 postcomputes.append(x.__dask_postcompute__())
567
--> 568 results = schedule(dsk, keys, **kwargs)
569 return repack([f(r, *a) for r, (f, a) in zip(results, postcomputes)])
570
~/opt/anaconda3/envs/scipy2021-bioimage-analysis/lib/python3.8/site-packages/dask/threaded.py in get(dsk, result, cache, num_workers, pool, **kwargs)
77 pool = MultiprocessingPoolExecutor(pool)
78
---> 79 results = get_async(
80 pool.submit,
81 pool._max_workers,
~/opt/anaconda3/envs/scipy2021-bioimage-analysis/lib/python3.8/site-packages/dask/local.py in get_async(submit, num_workers, dsk, result, cache, get_id, rerun_exceptions_locally, pack_exception, raise_exception, callbacks, dumps, loads, chunksize, **kwargs)
512 _execute_task(task, data) # Re-execute locally
513 else:
--> 514 raise_exception(exc, tb)
515 res, worker_id = loads(res_info)
516 state["cache"][key] = res
~/opt/anaconda3/envs/scipy2021-bioimage-analysis/lib/python3.8/site-packages/dask/local.py in reraise(exc, tb)
323 if exc.__traceback__ is not tb:
324 raise exc.with_traceback(tb)
--> 325 raise exc
326
327
~/opt/anaconda3/envs/scipy2021-bioimage-analysis/lib/python3.8/site-packages/dask/local.py in execute_task(key, task_info, dumps, loads, get_id, pack_exception)
221 try:
222 task, data = loads(task_info)
--> 223 result = _execute_task(task, data)
224 id = get_id()
225 result = dumps((result, id))
~/opt/anaconda3/envs/scipy2021-bioimage-analysis/lib/python3.8/site-packages/dask/core.py in _execute_task(arg, cache, dsk)
119 # temporaries by their reference count and can execute certain
120 # operations in-place.
--> 121 return func(*(_execute_task(a, cache) for a in args))
122 elif not ishashable(arg):
123 return arg
IndexError: too many indices for array: array is 3-dimensional, but 4 were indexed
so something is going wrong with dask-image or the data, it has nothing to do with napari
solved by pinning dask-image==0.5.0
@jni I'm running into a dask issue in lesson 3 - at the
viewer = napari.view_image(embryo)
call. Any idea what's going wrong? Could be a dask-image bug?